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

SQL Server 2000 DTS Package moved but @@servername returns orig name

Status
Not open for further replies.

NickW2

Programmer
Jul 23, 2003
12
0
0
GB
Under SQL Server 2000.
I have a DTS Package which runs a query in an Execute SQL Task which references @@servername. This works fine.
However, when I did a "save as" to copy the package to another server, and execute the package on the new server, @@servername strangely appears to return the name of the original server rather than the new one, in the query inside the package.

But if I run SELECT @@servername from Query Analyser on the new server it returns the name of the new server as expected.

Does anyone know what is wrong?
 
In the copy of the package, when I explicitly changed the "Server:" in the Connection Properties for the "Microsoft OLE Provider for SQL Server" (this is also known as the DataSource property) from the original server name to the new server name, the package works as required.

I was hoping not to have to do this, and I had actually set up an entry in a Dynamic Properties task to set the DataSource property to the result of the query "SELECT @@servername".

It looks as though @@servername here is being derived from the default DataSource value though, which undermines my attempts at making this portable.

Does anyone know anything further?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top