Stored procedures

From Species File Help
(Difference between revisions)
Jump to: navigation, search
(Created page with " * Stored procedures are kept in source control, and normally published to the database during builds * To debug a stored procedure against the database # Open SSMS, find the ...")
 
m (Maehr moved page Debugging Stored Procedures to Stored procedures: Made into less specific page since no general description exists.)
 
(2 intermediate revisions by one user not shown)
Line 4: Line 4:
 
# Open SSMS, find the database containing the SP, and navigate to '''programmability'', you'll find a list of SPs
 
# Open SSMS, find the database containing the SP, and navigate to '''programmability'', you'll find a list of SPs
 
# Right click, choose "Modify" ''or'' '''Script to -> Alter''', you'll get the code in a new query window
 
# Right click, choose "Modify" ''or'' '''Script to -> Alter''', you'll get the code in a new query window
 
 
# To execute the SP in SSMS right click, chose "Execute", you'll get a popup that will allow you to parameterize the SP, it will then generate *and execute* something like the following (this can be used subsequently to step through the SP):
 
# To execute the SP in SSMS right click, chose "Execute", you'll get a popup that will allow you to parameterize the SP, it will then generate *and execute* something like the following (this can be used subsequently to step through the SP):
  
Line 16: Line 15:
 
   SELECT 'Return Value' = @return_value
 
   SELECT 'Return Value' = @return_value
 
   GO
 
   GO
 +
 +
[[Category:Developers]]

Latest revision as of 18:00, 15 February 2013

  • Stored procedures are kept in source control, and normally published to the database during builds
  • To debug a stored procedure against the database
  1. Open SSMS, find the database containing the SP, and navigate to 'programmability, you'll find a list of SPs
  2. Right click, choose "Modify" or Script to -> Alter, you'll get the code in a new query window
  3. To execute the SP in SSMS right click, chose "Execute", you'll get a popup that will allow you to parameterize the SP, it will then generate *and execute* something like the following (this can be used subsequently to step through the SP):
 USE [SFdbPractice]
 GO
 DECLARE	@return_value int
 EXEC	@return_value = [dbo].[spTestSpecimenLocNotInDist]
 @blnFix = 0,
 @intFileID = 1, 
 @intFileUserID = 11
 SELECT	'Return Value' = @return_value
 GO
Personal tools
Namespaces

Variants
Actions
Navigation
Species Files
Wiki
Toolbox