Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 1234»»»

What SQL Statements Are Currently Executing? Expand / Collapse
Author
Message
Posted Monday, October 27, 2008 9:50 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, December 9, 2014 7:53 AM
Points: 49, Visits: 850
Comments posted to this topic are about the item What SQL Statements Are Currently Executing?
Post #592610
Posted Monday, October 27, 2008 9:52 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 2:11 PM
Points: 35,772, Visits: 32,441
Heh... and I get my butt chewed for using deprecated forms of aliased column names. ;) I don't feel so bad, now.

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #592611
Posted Tuesday, October 28, 2008 1:02 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, September 7, 2012 12:30 PM
Points: 37, Visits: 136
Really helpful
Post #592647
Posted Tuesday, October 28, 2008 2:45 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, December 8, 2014 7:09 AM
Points: 2, Visits: 82
I get this error when creating the SP: Msg 102, Level 15, State 1, Procedure dba_WhatSQLIsExecuting, Line 42 Incorrect syntax near '.'.
Line 42 is the 'CROSS APPLY' line.
Can anyone help?
Post #592678
Posted Tuesday, October 28, 2008 3:21 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, December 16, 2014 8:26 AM
Points: 2,716, Visits: 2,484
Mark,

are you sure you are running this against a SQL2005 instance?

Kev
Post #592689
Posted Tuesday, October 28, 2008 3:36 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, December 8, 2014 7:09 AM
Points: 2, Visits: 82
Kev,
Thanks - the server was 2005 but the compatibility level was still 2000. It worked find after that change.
Mark
Post #592696
Posted Tuesday, October 28, 2008 5:56 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 2, 2009 5:32 AM
Points: 3, Visits: 9
I ran this in a new query window and it ran successfully. I did not get an output. How do I view the results????

If I run it again I get the following message.

Msg 2714, Level 16, State 3, Procedure dba_WhatSQLIsExecuting, Line 17
There is already an object named 'dba_WhatSQLIsExecuting' in the database.
Post #592773
Posted Tuesday, October 28, 2008 5:59 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, December 16, 2014 8:26 AM
Points: 2,716, Visits: 2,484
dhayes,

I guess you are new to SQL :)

The first time you ran the script, you were creating a stored procedure, teh scond time errored, as you found out, because the proc already exists!

To run the proc use

exec dba_WhatSQLIsExecuting

ensuring you are in the right database.....



Kev
Post #592776
Posted Tuesday, October 28, 2008 6:09 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 2, 2009 5:32 AM
Points: 3, Visits: 9
Thank You Kev.

I'm not new to SQL, I'm just not a SQL DBA. I work with Sql every day, just don't normally call Stored procedures. Primarily do backups, and Database creations.

Thanks again for the info.

Don
Post #592780
Posted Tuesday, October 28, 2008 6:31 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, December 31, 2008 1:25 PM
Points: 2, Visits: 20
Msg 170, Level 15, State 1, Procedure dba_WhatSQLIsExecuting, Line 26
Line 26: Incorrect syntax near 'MAX'.

-- IRADBA Wannabe
Post #592797
« Prev Topic | Next Topic »

Add to briefcase 1234»»»

Permissions Expand / Collapse