dbTalk Databases Forums  

Search for a table/string within job steps, dts, database, stored procedures etc

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Search for a table/string within job steps, dts, database, stored procedures etc in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rshivaraman@gmail.com
 
Posts: n/a

Default Search for a table/string within job steps, dts, database, stored procedures etc - 05-16-2007 , 07:42 AM






Hi All :

A couple of tables have been identified to be deleted. My job is to
find if it is at all used.
On searching the web, i found a proc to search for a string within all
databases in a server.
using system sproc : sp_msforeachdb

it searches for a string in
views, sprocs, functions, check constraints, defaults, foreign key,
scalar function, inlined tablefunction, primary key, 'Replication
filter stored procedure, System table, Table function, Trigger, 'User
table, 'UNIQUE constraint''Extended stored procedure'

So it is pretty extensive. But i dont think it is covering the code
within execsqltasks in DTS, and tsql code within JOB STEPS. Those are
the two more places where code exists in my server.

If any of you have done so in the past, do let me know if there is a
system stored proc or code that you have written, to do the same

thanks
RS

Link to the above procedure

http://www.sql-server-performance.co...se_objects.asp


Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Search for a table/string within job steps, dts, database, stored procedures etc - 05-16-2007 , 05:49 PM






(rshivaraman (AT) gmail (DOT) com) writes:
Quote:
A couple of tables have been identified to be deleted. My job is to
find if it is at all used.
On searching the web, i found a proc to search for a string within all
databases in a server.
using system sproc : sp_msforeachdb

it searches for a string in
views, sprocs, functions, check constraints, defaults, foreign key,
scalar function, inlined tablefunction, primary key, 'Replication
filter stored procedure, System table, Table function, Trigger, 'User
table, 'UNIQUE constraint''Extended stored procedure'

So it is pretty extensive. But i dont think it is covering the code
within execsqltasks in DTS, and tsql code within JOB STEPS. Those are
the two more places where code exists in my server.

If any of you have done so in the past, do let me know if there is a
system stored proc or code that you have written, to do the same
If you don't have all your code under version control, this is about
an impossible task. Keep in mind that in SQL 2000, the code in syscomments
is chopped up in pieces of 4000 characters, and the table name may be
split in two parts.

One strategy may be to rename the tables, and then see how much explodes.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.