Click here to Skip to main content
15,896,359 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,

I have 100 sp which contain lot of update statement. I want to insert one line(Audit Sp Calling) below to that all update statement.

Example

Create Procedure TestSp
Begin

Line 1 ....
Line 2 ...
Line 3 Update Test Set
Line 4 Status='A'
Line 5 Where ID=1
Line 6
Line 7 select * from Test
Line 8 .....
Line 9 ....

Now i want to insert one line in Line 6 "Call SP Sample line"

Line 1 ....
Line 2 ...
Line 3 Update Test Set
Line 4 Status='A'
Line 5 Where ID=1
Line 6 Call SP Sample Line
Line 7
Line 8 select * from Test
Line 9 .....
Line 10 ....


Thanks
Posted
Updated 14-Mar-12 2:29am
v2

read each file line by line in a stringbuilder.
In the stringbuilder class you can insert a line see here[^]
 
Share this answer
 
use below line :
EXEC SP_NAME
 
Share this answer
 
Comments
senthil sennu 14-Mar-12 8:47am    
All the sp we have it as .sql file. No need for EXEC SP_NAME. I cant able do the changes manually as their are more than 500 sp

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