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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-03-29 : 08:51:05
|
| Arun writes "How do I get the result for the follwing dynamic querry.I get the error @transno variable not declareddeclare @sqlstring varchar(1024)declare @transno char(15)declare @Primary varchar(50)declare @Tablename varchar(255)set @sqlstring='select @transno = max(' + @Primary +')from ' + @Tablenameexec(@sqlstring)" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2006-03-29 : 08:54:15
|
| set @sqlstring='select ' + @transno + ' = max(' + @Primary +')from ' + @Tablename |
 |
|
|
|
|
|