Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
a_r_satish
Yak Posting Veteran
84 Posts |
Posted - 2006-01-17 : 08:27:50
|
Hi,For my application, i need the following details.I need to create a table that stores the stored procedures that are used in a database along with the tables that are used in it.I have got the stored procedures and its create statement from the sysobjects and the syscomments.But to get the individual tables in seperate column, i have a faced a lot of problems.Now for the tables used in the stored procedure, i need the fields used from that table and the operation done in my stored procedure.I hope i am not confusing To Make it Clear : A table with the stored procedures and the tables and fields along with the operation used in that stored procedure.can anyone help me??Thanks in advance.Regards,satish.r |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-17 : 08:41:28
|
See if this helpsselect P.specific_name,P.Routine_definition,T.table_name from information_Schema.routines Pinner join information_Schema.Tables T on P.Routine_definition like '%'+T.table_name+'%'order by P.specific_name MadhivananFailing to plan is Planning to fail |
 |
|
|
a_r_satish
Yak Posting Veteran
84 Posts |
Posted - 2006-01-18 : 01:29:45
|
| Thanks that works...But can u suggest me how to get the fields affected in the tables and the details about the query???Whether it is a create/alter/select/insert query in that stored procedure.Thanks in advance,satish.rRegards,satish.r |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-18 : 02:28:10
|
| Not sure what you meantRun the Profiler and check the changes that happens on the objectsMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|