Click here to Skip to main content
15,887,436 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Please when one writes a stored procedure, where is it written to amd saved.I expect that they are not created at run time Are they eritten and saved in a text file or what.How are they placed within the reach of the program?
Posted

Stored procedures are stored in the database (that's the reason they are called stored procedures). The text is stored in system tables - you can retrieve if from sys_modules like this:
SQL
select * from sys.sql_modules where object_id=object_id('MyStoredProcedure')
 
Share this answer
 
Comments
Gbenbam 4-Feb-14 6:40am    
How does one store them there in the first place?Will one create them at run time and store them in a field of a record in a table?
Pete O'Hanlon 4-Feb-14 6:46am    
The syntax of creating or amending a stored procedure takes care of this for you - you don't actually have to do much beyond add CREATE or ALTER PROC at the start to let SQL Server know what to do with the procedure.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900