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 |
|
tpayne
Starting Member
18 Posts |
Posted - 2008-10-15 : 10:42:43
|
| Is there a way to set the values of multiple variables using Select in one statement?I would like to do something like this.Select @cnt, @Name = Count(*), IDRIterationNameFrom tblIDRIterations Where IDRIteraionName = @IDRIterationNameThanks |
|
|
rohitkumar
Constraint Violating Yak Guru
472 Posts |
Posted - 2008-10-15 : 10:57:07
|
| yes you can very well do that, but your query syntax here is wrong (just in case if its the actual query you're using). |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-15 : 10:57:51
|
may be this is what you wantSelect @cnt= Count(*), @Name = IDRIterationNameFrom tblIDRIterations tWhere t.IDRIteraionName = @IDRIterationNameGROUP BY t.IDRIteraionName |
 |
|
|
tpayne
Starting Member
18 Posts |
Posted - 2008-10-15 : 11:07:43
|
| Thanks!!This is by far the best online forum I have seen!! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-15 : 11:09:25
|
quote: Originally posted by tpayne Thanks!!This is by far the best online forum I have seen!!
welcome |
 |
|
|
|
|
|