Executing the included query gives the following error:
"Msg 137, Level 15, State 2, Line 9
Must declare the variable '@imailTable'."
Replacing the @imailTable with dbo.ilivewell_net executes without error.
Thanks in advance for your help.
Jason
Code:
declare @imailTable varchar(30)
declare @userid varchar(30)
declare @PW2 varchar(31)
set @imailTable = 'dbo.ilivewell_net'
set @userid = 'deleteme'
select @PW2 = password
from @imailTable
where userid = @userid