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 |
|
sqlpal2009
Yak Posting Veteran
58 Posts |
Posted - 2009-08-25 : 09:06:15
|
| Hello All,I am writing a stored procedure which takes @Rowout as one of the parameter.My final select displays all the records but now I have to select only the records equals to the @Rowout.For example if @Rowout = 10 thenThe final Select should show only 10 records.Something like - SELECT TOP 10 * FROM #table1Can I do it without using dynamic SQL?Thanks for any help, |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-08-25 : 09:20:51
|
| SELECT TOP(@RowOut) FROM #Table1Jim |
 |
|
|
sqlpal2009
Yak Posting Veteran
58 Posts |
Posted - 2009-08-25 : 09:30:52
|
| Thanks Jim.That worked! |
 |
|
|
|
|
|