Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions Links


SQL Server DBA Jobs

How to script CREDENTIALS for SQL Server migration

25 April,2018 by Tom Collins

Question: I’m having some problems in migrating CREDENTIAL objects for SQL Server migrations.

The CREDENTIALS are used as part of the authentication method for PROXY accounts. When attempting to migrate via the scripted method , I think the password is corrupting?

What is a simple and effective method to script the CREATE statements and then include as part of the deployment package ?

Answer: It can be awkward to migrate the CREDENTIAL objects depending on the method you use. One simple method is to execute this code on the source SQL Server , it will create the CREATE statement. The only problem being is you need to add the password. Of course , you can add extra automation around this step depending on how you manage passwords


	'CREATE CREDENTIAL ' + name + ' WITH IDENTITY = ''' + credential_identity + ''', SECRET = ''MY-PASSWORD'';'
order by name;

Read more on Proxy account management 

How can I execute t-sql with a Proxy account

Author: Tom Collins (


Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment on How to script CREDENTIALS for SQL Server migration | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer