Advertisement

02.11.2008 at 04:50PM PST, ID: 23154877
[x]
Attachment Details

Need to search and replace text in all stored procedures in sql 2005 db

Asked by JCM0165 in SQL Server 2005

Tags: SQL

I am moving my sql database from one server to another at a different hosting company.
In order to connect, I had to change the owner of the tables, functions and stored procedures from
oldowner.stored_procedure_1
to
dbo.stored_procedure_1
etc.

The problem is there are many references in stores procedures to tables with the oldowner name.
So, I want to do a search and replace.
for example, to change
SELECT Names from OldOwner.Dogs
to
SELECT Names from DBO.Dogs

Is there a simple way to do this?

Thanks in advanceStart Free Trial
[+][-]02.11.2008 at 04:57PM PST, ID: 20871795

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.11.2008 at 05:09PM PST, ID: 20871853

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.17.2008 at 07:32AM PST, ID: 20914305

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: SQL Server 2005
Tags: SQL
Sign Up Now!
Solution Provided By: JCM0165
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628