November 12, 2013 at 7:24 am
Is there a central location where all the @@ variables are described? What I am hoping for is a variable that contains the currently executing line number of the script. Currently I hard code that number for my debug, but of course as lines are added deleted those number drift.
I would add that searching for @@ in sql server does not seem to do the trick, and if I search for some known quantity (@@ROWCOUNT, etc.) I get the descriptions for that particular one, but no reference to the rest.
<><
Livin' down on the cube farm. Left, left, then a right.
November 12, 2013 at 8:05 am
didn't find a single list from Microsoft, but i found this one on codeproject:
http://www.codeproject.com/Articles/39131/Global-Variables-in-SQL-Server
•@@CONNECTIONS
•@@MAX_CONNECTIONS
•@@CPU_BUSY
•@@ERROR
•@@IDENTITY
•@@IDLE
•@@IO_BUSY
•@@LANGID
•@@LANGUAGE
•@@MAXCHARLEN
•@@PACK_RECEIVED
•@@PACK_SENT
•@@PACKET_ERRORS
•@@ROWCOUNT
•@@SERVERNAME
•@@SPID
•@@TEXTSIZE
•@@TIMETICKS
•@@TOTAL_ERRORS
•@@TOTAL_READ / @@TOTAL_WRITE
•@@TRANCOUNT
•@@VERSION
Lowell
November 12, 2013 at 8:47 am
By that list it looks like I am out of luck.
Thanks for the effort.
<><
Livin' down on the cube farm. Left, left, then a right.
November 12, 2013 at 6:15 pm
In the CATCH section of a TRY/CATCH block, you can use ERROR_LINE(), however it returns NULL if there is no current error.
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply