Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
Stored procedure
Stored procedure
Rate Topic
Display Mode
Topic Options
Author
Message
m.rajesh.uk
m.rajesh.uk
Posted Monday, February 11, 2013 9:24 PM
SSC-Enthusiastic
Group: General Forum Members
Last Login: 2 days ago @ 11:47 AM
Points: 109,
Visits: 273
Hi all,
I want to modify the existing stored procedure . What is the process and how can i know the new one is better than the old one.
I mean like query tuning is there way we can see how effective is that stored procedure
Post #1418736
Want a cool Sig
Want a cool Sig
Posted Monday, February 11, 2013 10:31 PM
SSC Veteran
Group: General Forum Members
Last Login: Friday, April 26, 2013 2:58 PM
Points: 221,
Visits: 452
Write it and test it. Tweak it and test it. Tweak some more and test it. test test test.
---------------------------------------------------------------
Mike Hahn - Future MCM 2025
Right way to ask for help!!
http://www.sqlservercentral.com/articles/Best+Practices/61537/
I post so I can see my avatar
I want a personal webpage
I want to win the lotto
I want a gf like Tiffa
Post #1418750
Grant Fritchey
Grant Fritchey
Posted Tuesday, February 12, 2013 4:04 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 12:19 PM
Points: 13,371,
Visits: 25,144
Stored procedure tuning is the same as query tuning. You measure the performance of the procedure, in terms of time to execute, logical reads and CPU. You make modifications to the procedure or the structures that the procedure calls, then you measure again. Repeat as necessary. Follow the link to my book. I detail this process and more.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1418859
devaji123
devaji123
Posted Tuesday, February 12, 2013 6:05 AM
Grasshopper
Group: General Forum Members
Last Login: Thursday, April 04, 2013 4:05 AM
Points: 15,
Visits: 170
Try this way, comment the create procedure line using declare give values to the parameters and run it as query and now you can check the place where you made changes and execute the temp tables and the logic query on the same query tab in such way you can know which query is taking more time and why.
The other way is use SQL profiler.
Post #1418912
Grant Fritchey
Grant Fritchey
Posted Tuesday, February 12, 2013 6:08 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 12:19 PM
Points: 13,371,
Visits: 25,144
devaji123 (2/12/2013)
Try this way, comment the create procedure line using declare give values to the parameters and run it as query and now you can check the place where you made changes and execute the temp tables and the logic query on the same query tab in such way you can know which query is taking more time and why.
The other way is use SQL profiler.
Just know that if you're passing values to the parameters locally, as variables, it changes the way the procedure will be resolved because the optimizer will not be able to sniff the local variables in the same way it can parameters. In general, I wouldn't recommend this approach. Just call the procedure and pass it the parameters you want.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1418914
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.