ChrisTullier

I am trying to script the creation of a linked server for my database project. I have placed the command in the LinkedServer.sql file. The issue is that I cannot place the password as clear text in the script. I need to encrypt the password. How can I do this Also, setting up everyones local databases with the link rather than automating it though the script is not an option.

Re: Visual Studio Team System - Database Professionals Encrypting Linked Server password in pre-build script

Richard Waymire - MSFT

No, the password doesn't have a way to be pre-encrypted in a sql script to the best of my knowledge. So you'll have to create the linked server interactively to protect the password.




Re: Visual Studio Team System - Database Professionals Encrypting Linked Server password in pre-build script

Gert Drapers - MSFT

You can make the password a SQLCMD variable that you pass in at deploy time.

That way you do not have to store the password to begin with.

-GertD