Probably an really simple answer to this and probably one I should know !!
The below two statements return the same results so what is the value of using the local variable in the first ?
USE pubs
DECLARE @find varchar(30)
SET @find = 'Ring%'
SELECT au_lname, au_fname, phone
FROM authors
WHERE au_lname LIKE @find
USE pubs
SELECT au_lname, au_fname, phone
FROM authors
WHERE au_lname LIKE 'Ring%'
Thanks
DBomrrsm
The below two statements return the same results so what is the value of using the local variable in the first ?
USE pubs
DECLARE @find varchar(30)
SET @find = 'Ring%'
SELECT au_lname, au_fname, phone
FROM authors
WHERE au_lname LIKE @find
USE pubs
SELECT au_lname, au_fname, phone
FROM authors
WHERE au_lname LIKE 'Ring%'
Thanks
DBomrrsm