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 |
|
kling
Starting Member
12 Posts |
Posted - 2003-08-14 : 19:26:10
|
| Hi,I got an "Incorrect syntax" error when I try to use the Top clause with a variable in my Stored Procedure. How should it be done? Below is my procedure!--------------------------------------create procedure testSP (@rows int)as select top @rows * from myTable go--------------------------------------Thanks!-Kevin |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-08-14 : 19:31:38
|
| You cannot use a variable with TOP. You can do this however:create procedure testSP (@rows int) asset rowcount @rowsselect * from myTable set rowcount 0 |
 |
|
|
|
|
|