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
 General SQL Server Forums
 New to SQL Server Programming
 msg 102, level 15

Author  Topic 

n0rr15
Starting Member

3 Posts

Posted - 2012-01-04 : 13:19:09
can anyone help me with this? I cannot for the life of me find why this is erroring out...I assume it's a spacing issue?
SQL 2005

Use Master
select spid, blocked, hostname, program_name, nt_username, cmd from sysprocesses where blocked = 0
and spid in (select distinct blocked from sysprocesses where blocked <> 0 )

I'm, pretty new to stretching my sql muscles but will be doing so a LOT in the future...below is the error..

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ' '.


Rick Norris

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-04 : 13:22:41
not sure error is in posted code as its compiling fine for me

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-01-04 : 13:23:13
USE [master]
GO
select spid, blocked, hostname, program_name, nt_username, cmd from sysprocesses where blocked = 0
and spid in (select distinct blocked from sysprocesses where blocked <> 0 )
GO

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

n0rr15
Starting Member

3 Posts

Posted - 2012-01-04 : 13:35:50
Much appreciated... thanks alot I have it working fine now

Rick Norris
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-01-04 : 13:45:47
water closet

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -