You are here: Re: SQL 2000 Stored Procedure move « MsSQL Server « IT news, forums, messages
Re: SQL 2000 Stored Procedure move

Posted by Erland Sommarskog on 12/18/06 11:42

(testbox@magaff.co.uk) writes:
> I have a MSSQL2000 box with a large database containing circa 150 SP's.
> I want to move the DB to another SQL machine, but many of the SP's have
> references to the name of the current machine. Is there any way to
> batch edit the procedures to refer to the new server, disassociating
> the old machine completely?

Check out the files from the version-control system, and use an editor
like Textpad to do search/replace in the files.

You don't have the code under version-control? Well, you should. :-) You
can always script out the procedures from Enterprise Manager and then
apply the same procedure. In this case, it's probably easier to have all
in one file.

I don't really know why have the machine code hard-coded all over the
place. Maybe it would be better to use @@servername, so you don't have
to redo the exercise next time you move?


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация