Concerned with Top in sql

Posted by ramyatk06 on Stack Overflow See other posts from Stack Overflow or by ramyatk06
Published on 2010-03-26T11:01:47Z Indexed on 2010/03/26 11:03 UTC
Read the original article Hit count: 346

Filed under:
|

hi guys, I have variable @count of datatype int.I am setting values to this @count. I want to select top @count number of rows from table.When i use Select top @count,its showing error.

Delete from ItemDetails where  GroupId in (Select Top @count  Id from ItemDetails where GroupId=@Prm_GroupId )

The error is Incorrect syntax near '@count'.Can anybody help?

© Stack Overflow or respective owner

Related posts about sql

Related posts about 2005