473,385 Members | 1,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

mssql question

How do you limit the number of rows that is fetched at the database,
in MySQL you could use the keyword 'LIMIT', is there something like that for
MSSQL?
Nov 19 '05 #1
5 973
select TOP * from ...

posted in wrong forum though :)

"Patrick F" wrote:
How do you limit the number of rows that is fetched at the database,
in MySQL you could use the keyword 'LIMIT', is there something like that for
MSSQL?

Nov 19 '05 #2
SELECT * FROM messages ORDER BY (skapad) TOP 15

results in the following errorcode:

Error -2147217900
Incorrect syntax near the keyword 'top'.

Server version : Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
if that is of any importance

- Patrick
"Curt_C [MVP]" wrote:
TOP

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Patrick F" wrote:
How do you limit the number of rows that is fetched at the database,
in MySQL you could use the keyword 'LIMIT', is there something like that for
MSSQL?

Nov 19 '05 #3
Try

SELECT TOP 15 FROM messages ORDER BY (skapad)

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Patrick F" <Pa******@discussions.microsoft.com> wrote in message
news:9B**********************************@microsof t.com...
SELECT * FROM messages ORDER BY (skapad) TOP 15

results in the following errorcode:

Error -2147217900
Incorrect syntax near the keyword 'top'.

Server version : Microsoft SQL Server 2000 - 8.00.2039 (Intel X86)
if that is of any importance

- Patrick
"Curt_C [MVP]" wrote:
TOP

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Patrick F" wrote:
> How do you limit the number of rows that is fetched at the database,
> in MySQL you could use the keyword 'LIMIT', is there something like that for
> MSSQL?

Nov 19 '05 #4
works perfect, thanks

"Sreejith Ram" wrote:
select TOP * from ...

posted in wrong forum though :)

"Patrick F" wrote:
How do you limit the number of rows that is fetched at the database,
in MySQL you could use the keyword 'LIMIT', is there something like that for
MSSQL?

Nov 19 '05 #5
Patrick for a reference see :- http://www.transactsql.com/html/home.html
Hope that helps
Patrick
"Patrick F" <Pa******@discussions.microsoft.com> wrote in message
news:17**********************************@microsof t.com...
works perfect, thanks

"Sreejith Ram" wrote:
select TOP * from ...

posted in wrong forum though :)

"Patrick F" wrote:
How do you limit the number of rows that is fetched at the database,
in MySQL you could use the keyword 'LIMIT', is there something like that for MSSQL?

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: mj | last post by:
Hello, thanks for the help. I am running a WinXP Pro w/ SP2 (my home computer, with ZoneAlarm firewall) Apache 2.0.52 MySQL 4.1.7 PHP 5.1.0-dev I have developed a PHP/MySQL web app that...
3
by: francisl | last post by:
We have to build some script were I work to make a dynamic server inventory. But, the project team, a windows crew, start it all in vbscript and on mssql. Note, due to political reason, we can...
4
by: Leader | last post by:
Hi All, I have question and that is-- if i have a database that is implemented in MSDE Now i want the same database in MSSQL. What are the steps i do need to follow for this. Thanks in Advance...
2
by: Martin Feuersteiner | last post by:
Hi! This is a very basic question.. don't make fun of me please! I'm confused by all this logins, users, roles etc.. What I want to do it is to have an ASP.NET application that uses MSSQL as a...
0
by: SonGoten13 | last post by:
Hi The situation is that i should check on my intranet-page the rights of the user to decide wich information he can access. I have to use the Windows Login Information(User/pw). I found out that...
8
by: eugenio | last post by:
Hi...not sure if this is the right group for this posting, but i'm don't know where else to post. I've got a simple problem...I have a linux box running apache 2.0 and php5. I'm trying to use the...
1
by: bang giang | last post by:
Hi, Recently I had somebody build a website for me. The website guy uses mssql as the platform for database storage. I was told that mssql's can only store upto 100,000 sign member/records. ...
2
by: grandmasterneil | last post by:
I have a couple of servers here at work that run IIS, MSSQL, and ASP.NET. I have PHP installed and running via Apache on my laptop. I was wondering if I can run code on my laptop (PHP/Apache)...
5
by: eisenstein | last post by:
i read out an utf-8 xml file with greek or russian/cyrillic characters. i can display it in the browser but if i insert data into an mssql database -field is nvarchar(4000)- i only see ??? or...
0
by: 123bargains | last post by:
Hello, I have a question on importing a database from MSSQL 2000 to MSSQL 2005. I hope someone on here can help me answer it. I am trying to import a database from MSSQL 2000 to 2005. But, when I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.