Packager and Linked Servers
dm4714
Posts: 28
Does/Can SQL Packager support the ability to connect to Linked Servers?
I have an application that has local tables and stored procedures. However, I need to connect to a remote server.
I would like SQL Packager to prompt or something for the Linked Server information so it can be automatically created.
If SQL Packager doesn't support this, does anyone know of any workarounds?
I have an application that has local tables and stored procedures. However, I need to connect to a remote server.
I would like SQL Packager to prompt or something for the Linked Server information so it can be automatically created.
If SQL Packager doesn't support this, does anyone know of any workarounds?
This discussion has been closed.
Comments
Packager does not currently have the ability to recognised a linked server, and recreate the link in a target server.
This is a question that has been raised on occasion, and so far the only work around is to manually create the entry or use the store procedure sp_addlinkedserver, and maybe sp_addlinkedsrvlogin, in a custom script.
Regards
Dan
Red Gate Software Ltd
If I use a custom script, I assume I can include this and run it as part of Packager?
If so, how can I obtain user input to pass to the script? I mean, it would be different per installation based on user requirements.
Also, it would be nice if the Servername, Login name, Password, and database names could be passed as parameters to a custom script and replaced keywords within the script.
This way generic .sql scripts can be created that can use fields from SQL Package.
A script script for example:
USE master;
GO
EXEC sp_addlinkedserver '%SERVERNAME%', 'SQL Server'
GO
EXEC sp_addlinkedsrvlogin '%SERVERNAME%', 'false', '%LOCALLOGIN%', 'myremotelogin', '%PASSWORD%'
GO