Groups | Blog | Home
all groups > sql server dts > february 2005 >

sql server dts : Hello guys


eleftheriak NO[at]SPAM hotmail.com
2/21/2005 5:57:59 AM
Do you know how to back up all the DTS packages automatically without
having to put the server name inside the VBscript?

Thanks in advance

BIBIBO
Ed Enstrom
2/21/2005 9:30:30 AM
[quoted text, click to view]

Not sure if this will help you, but I never use the real server name in a script
or DTS package. I always use an alias name (CName). In fact, I do it at the
level of the database. With this approach, I can move a db and its associated
scripts and packages to a different machine and everything continues to work.
All I have to do is change the DNS entry to point to the new machine. This
works for SQL Server, mapped drives, client ODBC connections, etc.

For example, I recently moved my company's data warehouse database to a new,
faster server. All apps referred to "DWprod" as the server name, which was
really an alias. After moving the db, we changed the DNS entry for "DWprod"
and everthing worked fine.

You can also add an entry in the HOSTS file on the machine where your script is
running to point to the target server. By changing the HOSTS file entry every
time you run the script, you can run the same script and have it operate on
different servers. You should run ipconfig/flushdns to clear the cache after
you change HOSTS. Remember to remove the HOSTS file entry when you are done.

HTH

Ed


Allan Mitchell
2/21/2005 7:16:30 PM
Nice trick

You can also create an alias using cliconfg and use the same way.

As for the original post of can you move and change in one go then the
answer is no.

Ideally things like Servername should be as has been mentioned i.e.
controlled outside of the package or you should set the package up to
look somewhere to fond the server names and then set internally.




[quoted text, click to view]
Michael Vardinghus
2/22/2005 3:22:51 PM
Do you have an example of setting it internally ?

is it active x + parameter + connection

[quoted text, click to view]

Allan Mitchell
2/22/2005 6:58:03 PM
OK So you can either use the Dynamic properties task to query an
external source or if you are using SQL Server 7 (or 2000) you can grab
it yourself into a variable and do something like

DTSGlobalVariables.Parent.Connection("My Text File
Connection").DataSource = DTSGlobalVariables("File Name).Value






[quoted text, click to view]
AddThis Social Bookmark Button