Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
phishCoder
Starting Member
4 Posts |
Posted - 2006-09-27 : 13:01:38
|
| Executing the included query gives the following error:"Msg 137, Level 15, State 2, Line 9Must declare the variable '@imailTable'."Replacing the @imailTable with dbo.ilivewell_net executes without error.Thanks in advance for your help.Jasondeclare @imailTable varchar(30)declare @userid varchar(30)declare @PW2 varchar(31)set @imailTable = 'dbo.ilivewell_net'set @userid = 'deleteme'select @PW2 = password from @imailTablewhere userid = @userid |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2006-09-27 : 13:02:34
|
| Look up Dynamic Sql.Or, do not use a table name as a variable. no real reason for it.[Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|