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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select TOP @NumRows

Author  Topic 

vmon
Yak Posting Veteran

63 Posts

Posted - 2005-09-09 : 13:45:35
Can I substitue the number of rows to select dynamically from a cursor variable. Not sure how or what to do with this.

SELECT TOP @NumberRows dbo.tblItem.ItemId FROM dbo.tblItem

thanks,
vmon

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-09-09 : 13:47:41
Here's the article:
http://www.sqlteam.com/item.asp?ItemID=233

Always do an article search from the main page as well as a search in the forums to see if your question has been asked already. The forum search doesn't work as well as it used to though, but the article search does.

Tara
Go to Top of Page

vmon
Yak Posting Veteran

63 Posts

Posted - 2005-09-09 : 14:17:02
Thank you. I found the answer and came back to post it and you beat me to it.

Books online Set Rowcount @variable

thanks again,
vmon
Go to Top of Page
   

- Advertisement -