Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored PRocedure List / Compare

Status
Not open for further replies.

steveot

IS-IT--Management
Joined
Oct 27, 2003
Messages
1,635
Location
US
Is there any way with osql to compare the stored procedure for a give database againts a fixed list.

In other word I know that a database is supposed to have 100 stored procedures and if one is deleted I would like to query the stored procedures and be able to tell which procedure got deleted.

I know is can use sp_stored_procedure to list the procedure but would either like to dumpt this list to a file so i can compare it or it its possible to write something to compared the dump list against the a fix list and tell me what is missing.

 
You can capture the results of sp_stored_procedures in to a temp table, then do anything you'd like with it.

Code:
Create 
Table  #Temp(
       Procedure_Qualifier VarChar(50), 
       Procedure_Owner VarChar(50), 
       Procedure_Name VarChar(100), 
       Num_Input_Params Integer, 
       Num_Output_Params Integer, 
       Num_Result_Sets Integer, 
       Remarks VarChar(1000), 
       Procedure_Type Integer)

Insert Into #Temp
Exec sp_stored_procedures 

Select Procedure_Name From #temp

Drop Table #Temp

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top