Follow sqlserver-dba.com

Daily & Exclusive Content

Delivered by FeedBurner

SQLServer-DBA.com Links

Dba_db2_button

Powered by TypePad
How to script CREDENTIALS for SQL Server migration

25 April,2018 by Jack Vamvas

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

 

select
	'CREATE CREDENTIAL ' + name + ' WITH IDENTITY = ''' + credential_identity + ''', SECRET = ''MY-PASSWORD'';'
from
	sys.credentials 
order by name;


 


Author: Jack Vamvas (http://www.sqlserver-dba.com)


Share:

Verify your Comment

Previewing your Comment

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

Working...
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.

Working...

Post a comment on How to script CREDENTIALS for SQL Server migration


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer