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 - 2001-07-19 : 21:12:02
|
| Andrew writes "I tried to send this once before but I messed it up. Here goes..SQL 7.0 SP 3NT 4.0 SP 6aI need to create T-SQL variables at run-time. The amount of variables that I need to create is not known until run-time. So essentially, I need a DECLARE statement, in a loop, that creates then necessary number of variables.Something like this...WHILE @counter > 0 --@counter is not known until run-timeBEGINDECLARE @test + @counter VARCHAR(10) --This fails because I suckSET @counter = @counter - 1ENDAny help, ideas or direction would be much appreciated...ThanksAndrew" |
|
|
|
|
|