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

Stored procedure Expand / Collapse
Author
Message
Posted Monday, February 11, 2013 9:24 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, November 19, 2014 4:00 AM
Points: 190, Visits: 476
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
Posted Monday, February 11, 2013 10:31 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, April 24, 2014 9:12 AM
Points: 285, Visits: 504
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
Posted Tuesday, February 12, 2013 4:04 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 4:03 PM
Points: 14,017, Visits: 28,396
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 Query Performance Tuning
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
Posted Tuesday, February 12, 2013 6:05 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Yesterday @ 3:10 AM
Points: 15, Visits: 208
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
Posted Tuesday, February 12, 2013 6:08 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 4:03 PM
Points: 14,017, Visits: 28,396
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 Query Performance Tuning
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 »

Add to briefcase

Permissions Expand / Collapse