Click here to Skip to main content
15,943,245 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please somebody help out on how to create Stored Procedure programmatically in MSSql Server
Posted

1 solution

It might have been nice if you actually mentioned what language you wanted to do this in. I almost did not notice the C# tag.

Execute an SqlCommand (use ExecuteNonQuery) whose CommandText contains the entirety of the Create Procedure TSQL command:

Create Procedure MyProc 
@myfirstParam int = 0,
...
@mylastparam nvarchar(255) = null
As
Begin
....
End
 
Share this answer
 

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