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 |
|
sql_wedge
Starting Member
18 Posts |
Posted - 2005-08-11 : 10:15:32
|
| Hi I know if you declare a variable you can then assign it a value by using th 'SET @variablename =' command, but is there a way in which you can assign multiple variables values from a select queryeg. select into @variable1,@variable2 from select variable1,variable2 from tablenamethanksI hope i made myself clear |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-08-11 : 10:18:21
|
select @variable1 = variable1, @variable2 = variable2 from tablenamethis however will set the variables to last to values of the set if the set has more than 1 row returned.Go with the flow & have fun! Else fight the flow |
 |
|
|
sql_wedge
Starting Member
18 Posts |
Posted - 2005-08-11 : 10:28:31
|
| Thanks |
 |
|
|
|
|
|