|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, May 20, 2013 6:22 AM
Points: 47,
Visits: 762
|
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Yesterday @ 7:36 PM
Points: 32,931,
Visits: 26,820
|
|
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."
For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, September 07, 2012 12:30 PM
Points: 37,
Visits: 136
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, February 22, 2013 1:30 AM
Points: 2,
Visits: 64
|
|
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?
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 12:01 PM
Points: 2,677,
Visits: 2,273
|
|
Mark,
are you sure you are running this against a SQL2005 instance?
Kev
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, February 22, 2013 1:30 AM
Points: 2,
Visits: 64
|
|
Kev, Thanks - the server was 2005 but the compatibility level was still 2000. It worked find after that change. Mark
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, July 02, 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.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 12:01 PM
Points: 2,677,
Visits: 2,273
|
|
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
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, July 02, 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
|
|
|
|
|
Forum 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
|
|
|
|