Showing posts with label returned. Show all posts
Showing posts with label returned. Show all posts

Friday, March 9, 2012

How to Limit the number of rows returned with MSSQL, like the MySQL Limit clause.

hi

I use to work with mysql but now I need mssql. Can somebody tell my how I canwork around LIMIT to select a number of records so I can display 10 records at a time in stead of all?

ThanksI think there is nothing exactly the same as LIMIT. But you can use TOP to get limited records. e.g. TOP 10 will return 10 records but this can not be used like TOP 20,10.

Moreover, you can loop the results to reach to your required result number and start displaying them. But this is not a good approach

I don't know the current implementation of TOP. I read this somewhere.|||I've edited the title of the thread, and moved it to the Sql Server / MSSQL Forums.

Moderator

Sunday, February 19, 2012

How to KILL a Suspended Sys Process?

I have a suspended process that sits in running processes returned by SP_WHO
for 3 days already.
SPID:10
Status: SUSPENDED
Login Name: sa
DB NAME: master
Command:CHECKPOINT
CPU Time: 2625937
DiskIO: 358622
An attempt to "kill 10 " failed saying that only user processes can be
killed.
Rebooting is not an option since it is a production server.
Is there anything else i can do to kill this process without re-starting the
server?
The job does not affect the performance of the server, but all attempts to
updatestats and backup database fail, and i am 100% sure that this is
because of this process.
Any help please.
Thank you.
low numbered spids are SYSTEM processes. You cannot (for obvious reasons)
KILL them.
What is it that makes you 100% think checkpoint thread is the root of your
problems?
Have you checked the sql error log for messages related to checkpointing?
TheSQLGuru
President
Indicium Resources, Inc.
"Michael Kansky" <mike@.zazasoftware.com> wrote in message
news:u$zA7RFgHHA.284@.TK2MSFTNGP05.phx.gbl...
>I have a suspended process that sits in running processes returned by
>SP_WHO for 3 days already.
> SPID:10
> Status: SUSPENDED
> Login Name: sa
> DB NAME: master
> Command:CHECKPOINT
> CPU Time: 2625937
> DiskIO: 358622
> An attempt to "kill 10 " failed saying that only user processes can be
> killed.
> Rebooting is not an option since it is a production server.
> Is there anything else i can do to kill this process without re-starting
> the server?
> The job does not affect the performance of the server, but all attempts to
> updatestats and backup database fail, and i am 100% sure that this is
> because of this process.
> Any help please.
> Thank you.
>
|||On Apr 16, 2:24 pm, "Michael Kansky" <m...@.zazasoftware.com> wrote:
> I have a suspended process that sits in running processes returned by SP_WHO
> for 3 days already.
> SPID:10
> Status: SUSPENDED
> Login Name: sa
> DB NAME: master
> Command:CHECKPOINT
> CPU Time: 2625937
> DiskIO: 358622
> An attempt to "kill 10 " failed saying that only user processes can be
> killed.
> Rebooting is not an option since it is a production server.
> Is there anything else i can do to kill this process without re-starting the
> server?
> The job does not affect the performance of the server, but all attempts to
> updatestats and backup database fail, and i am 100% sure that this is
> because of this process.
> Any help please.
> Thank you.
the spids between 0 and 50 are system processes not user processes. If
you don't know what is going on, you can always find a down time and
stop/start the MSSQL service. This will kill and restart all system
processes.
Kristina

How to KILL a Suspended Sys Process?

I have a suspended process that sits in running processes returned by SP_WHO
for 3 days already.
SPID:10
Status: SUSPENDED
Login Name: sa
DB NAME: master
Command:CHECKPOINT
CPU Time: 2625937
DiskIO: 358622
An attempt to "kill 10 " failed saying that only user processes can be
killed.
Rebooting is not an option since it is a production server.
Is there anything else i can do to kill this process without re-starting the
server?
The job does not affect the performance of the server, but all attempts to
updatestats and backup database fail, and i am 100% sure that this is
because of this process.
Any help please.
Thank you.low numbered spids are SYSTEM processes. You cannot (for obvious reasons)
KILL them.
What is it that makes you 100% think checkpoint thread is the root of your
problems?
Have you checked the sql error log for messages related to checkpointing?
TheSQLGuru
President
Indicium Resources, Inc.
"Michael Kansky" <mike@.zazasoftware.com> wrote in message
news:u$zA7RFgHHA.284@.TK2MSFTNGP05.phx.gbl...
>I have a suspended process that sits in running processes returned by
>SP_WHO for 3 days already.
> SPID:10
> Status: SUSPENDED
> Login Name: sa
> DB NAME: master
> Command:CHECKPOINT
> CPU Time: 2625937
> DiskIO: 358622
> An attempt to "kill 10 " failed saying that only user processes can be
> killed.
> Rebooting is not an option since it is a production server.
> Is there anything else i can do to kill this process without re-starting
> the server?
> The job does not affect the performance of the server, but all attempts to
> updatestats and backup database fail, and i am 100% sure that this is
> because of this process.
> Any help please.
> Thank you.
>|||On Apr 16, 2:24 pm, "Michael Kansky" <m...@.zazasoftware.com> wrote:
> I have a suspended process that sits in running processes returned by SP_W
HO
> for 3 days already.
> SPID:10
> Status: SUSPENDED
> Login Name: sa
> DB NAME: master
> Command:CHECKPOINT
> CPU Time: 2625937
> DiskIO: 358622
> An attempt to "kill 10 " failed saying that only user processes can be
> killed.
> Rebooting is not an option since it is a production server.
> Is there anything else i can do to kill this process without re-starting t
he
> server?
> The job does not affect the performance of the server, but all attempts to
> updatestats and backup database fail, and i am 100% sure that this is
> because of this process.
> Any help please.
> Thank you.
the spids between 0 and 50 are system processes not user processes. If
you don't know what is going on, you can always find a down time and
stop/start the MSSQL service. This will kill and restart all system
processes.
Kristina

How to KILL a Suspended Sys Process?

I have a suspended process that sits in running processes returned by SP_WHO
for 3 days already.
SPID:10
Status: SUSPENDED
Login Name: sa
DB NAME: master
Command:CHECKPOINT
CPU Time: 2625937
DiskIO: 358622
An attempt to "kill 10 " failed saying that only user processes can be
killed.
Rebooting is not an option since it is a production server.
Is there anything else i can do to kill this process without re-starting the
server?
The job does not affect the performance of the server, but all attempts to
updatestats and backup database fail, and i am 100% sure that this is
because of this process.
Any help please.
Thank you.low numbered spids are SYSTEM processes. You cannot (for obvious reasons)
KILL them.
What is it that makes you 100% think checkpoint thread is the root of your
problems?
Have you checked the sql error log for messages related to checkpointing?
--
TheSQLGuru
President
Indicium Resources, Inc.
"Michael Kansky" <mike@.zazasoftware.com> wrote in message
news:u$zA7RFgHHA.284@.TK2MSFTNGP05.phx.gbl...
>I have a suspended process that sits in running processes returned by
>SP_WHO for 3 days already.
> SPID:10
> Status: SUSPENDED
> Login Name: sa
> DB NAME: master
> Command:CHECKPOINT
> CPU Time: 2625937
> DiskIO: 358622
> An attempt to "kill 10 " failed saying that only user processes can be
> killed.
> Rebooting is not an option since it is a production server.
> Is there anything else i can do to kill this process without re-starting
> the server?
> The job does not affect the performance of the server, but all attempts to
> updatestats and backup database fail, and i am 100% sure that this is
> because of this process.
> Any help please.
> Thank you.
>|||On Apr 16, 2:24 pm, "Michael Kansky" <m...@.zazasoftware.com> wrote:
> I have a suspended process that sits in running processes returned by SP_WHO
> for 3 days already.
> SPID:10
> Status: SUSPENDED
> Login Name: sa
> DB NAME: master
> Command:CHECKPOINT
> CPU Time: 2625937
> DiskIO: 358622
> An attempt to "kill 10 " failed saying that only user processes can be
> killed.
> Rebooting is not an option since it is a production server.
> Is there anything else i can do to kill this process without re-starting the
> server?
> The job does not affect the performance of the server, but all attempts to
> updatestats and backup database fail, and i am 100% sure that this is
> because of this process.
> Any help please.
> Thank you.
the spids between 0 and 50 are system processes not user processes. If
you don't know what is going on, you can always find a down time and
stop/start the MSSQL service. This will kill and restart all system
processes.
Kristina