SQL Server with Mr. Denny

Feb 24 2011   2:00PM GMT

ANSI Settings can have all the difference in the world.



Posted by: Denny Cherry
Tags:
Session State
SQL Server

So a little while back we noticed that we had some high CPU load coming from a single stored procedure in the Session State database.  This single procedure (TempUpdateStateItemLong) was taking up 80% of the CPU time that the database was using (we used Spotlight for SQL Server Enterprise from Quest software).  But in another session state database that same procedure was down in the single digits.  So something must be different between them.

I opened them both up in SSMS and the code for the procedures was identical (as you would expect), but there was something different.  The procedure that had the really high CPU % times was compiled with the SET QUOTED_IDENTIFIER ON setting, while the procedure that had the really low CPU % times was compiled with the SET QUOTED_IDENTIFIER OFF setting.

I have no idea why there was a difference, but I changed the one which was ON to OFF and pushed the procedure into the database.  As soon as I did the CPU % for that procedure dropped down into the single digit range where it should have been.

Let this be a lesson, those setting definitely matter.  And don’t trust that they are correct, even in Microsoft provided code like Session State.

Denny

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: