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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 limit function?

Author  Topic 

Mckay
Starting Member

8 Posts

Posted - 2006-02-08 : 01:21:45
hi,

is there any fuction in Sql Server that are similar like function 'limit' in MySql?

thx

Mckay

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2006-02-08 : 01:42:02
Hi,
You can use
Select Top n * from tablename which is equivalent to LIMIT 0, row_count
but there is nothing like LIMIT 3,4 (getting 4 rows starting from 4th)
for that you need to have an identity coumn in your table then use the IDENTITY column to get the necessary rows.

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-02-08 : 03:34:12
If you want to paginate the data, refer this
http://weblogs.sqlteam.com/jeffs/archive/2003/12/22/672.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -