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 |
cognos79
Posting Yak Master
241 Posts |
Posted - 2007-11-08 : 10:47:20
|
I want to assign the top 1 name returned to a variable. how do i doselect @name = top 1 [name] from Students |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-11-08 : 11:00:08
|
[code]select top 1 @name = name from Students[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
cognos79
Posting Yak Master
241 Posts |
Posted - 2007-11-08 : 11:13:29
|
Thanks |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-11-09 : 01:51:27
|
quote: Originally posted by cognos79 I want to assign the top 1 name returned to a variable. how do i doselect @name = top 1 [name] from Students
Using Order by clause will make senseMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|