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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search Stored Procedures

Status
Not open for further replies.

digitallyskilled

IS-IT--Management
Sep 23, 2004
39
US
I backed up a database and restored the files on my laptop so i can have a local copy. the restored version has references via stored procedures to the production databases. is there a quick way i can search for fully qualifyied references in the stored procedure and replace them with the local references.
 
not sure if there is a better way but I would script the SP's and then use a text editor to do a search and relace then run the amended SP's back into the DB

[bandito] [blue]DBomrrsm[/blue] [bandito]

[blue]Software code, like laws and sausages, should never be examined in production[/blue][black] - [/black][purple]Edward Tenner[/purple]
 
You can get a list of SPs that contain the db name by querying the system tables:

Code:
SELECT OBJECT_NAME(id)
FROM syscomments
WHERE text LIKE '%<db name>%'

You'll then need to go into each one and amend the name.

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top