KHUSHBOO BHATIA
KHUSHBOO BHATIA

Reputation: 11

Compiling stored procedures programmatically using c#

I have 500 stored procedures and want to compile all and if error comes it should write in file using c#. if anybody has similar example code help

Upvotes: 0

Views: 216

Answers (1)

behinafzar bahrami
behinafzar bahrami

Reputation: 63

If you call the command to alter a stored procedure once, if the execution of the command encounters an error, it means that your stored procedure has a problem.

You can get the stored procedure's script through the following script. Of course, this script returns the Create and you have to change it to Alter:

select name, object_definition(object_id) 
from sys.procedures

Upvotes: 0

Related Questions