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.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 Deployment: Search and replace

Author  Topic 

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-02-24 : 15:52:07
Greetings,

I script out all my procs and functions to .sql files. Currently the place I work at has one SQL server. When migrating from the DEV database to the TEST and to production I need to search and replace some references to the DEV and TEST databases. Is there a way of doing this from within SQL, mayb an SSIS package or some tools you can point me to?

Thank you

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2009-02-24 : 17:07:11
perhaps you can script them all to one big file.. so your search/replace becomes easy?

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-24 : 17:13:07
Concatenate all of the individual files together using this in a cmd window:

type C:\SomeFolder\*.sql > C:\SomeFolder\Concat.sql

Then do a find/replace in Concat.sql.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-02-24 : 17:37:09
excellent! Thank you very much.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-24 : 17:59:58
You're welcome.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -