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 |
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-12-18 : 06:49:21
|
| i have a stored procedure where i pass @numrecords which is the amount of records to returnbut when i doSELECT top @numrecords usernames from newusersi get an error -what's the correct syntax? |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-12-18 : 06:51:08
|
| Are you using SQL Server 2005?Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-12-18 : 06:53:30
|
SELECT top (@numrecords) usernames from newusers E 12°55'05.25"N 56°04'39.16" |
 |
|
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-12-18 : 06:56:18
|
| thanks - another field in the table is called sent -how can I when I select the x number of fields have that x number of fields marked as sent |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-12-18 : 06:59:13
|
[code]SELECT top (@numrecords) usernames from newuserswhere sent = 1[/code] E 12°55'05.25"N 56°04'39.16" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-18 : 07:16:05
|
quote: Originally posted by esthera thanks - another field in the table is called sent -how can I when I select the x number of fields have that x number of fields marked as sent
I am really surprised that you didnt figure it out yourself MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|