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

Code libraries / includes in stored procedures Expand / Collapse
Author
Message
Posted Wednesday, March 18, 2009 3:46 PM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Today @ 10:17 AM
Points: 130, Visits: 2,500


Recently I wrote a bunch of stored procedures that use the same 25 lines of code and then go on their way to do what they were designed to do.
Is there any functionality in stored procedures to include a chunk of code (library, include etc)?
This would avoid having to copy the code multiple times and if I wanted to change it I could do it in one place rather then in each stored procedure.

Thanks

David Weil



Post #678961
Posted Wednesday, March 18, 2009 3:55 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Sunday, November 4, 2012 12:23 PM
Points: 1,893, Visits: 3,932
Hi

I don't know any way to include code blocks. Maybe think about moving this code into a UDF or helper procedure.

Greets
Flo



The more I learn, the more I know what I do not know
Blog: Things about Software Architecture, .NET development and T-SQL

How to Post Data/Code to get the best Help How to Post Performance Problems
Post #678966
Posted Wednesday, March 18, 2009 5:15 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Tuesday, July 22, 2014 4:12 PM
Points: 758, Visits: 1,031
You may be able to move some of the common code into their own stored procedures or functions.

Failing that, have you considered using code templates?
Post #679013
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse