Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 script out credentials

Author  Topic 

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2011-12-13 : 15:37:30
Hi,

How to script out credentials under security tab in sql server 2005.

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-12-13 : 15:56:28
http://weblogs.sqlteam.com/tarad/archive/2008/06/24/How-to-transfer-SQL-logins-between-SQL-Server-2005-instances.aspx

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2011-12-13 : 16:34:37
Thanks Tara for reply. There is one tab under security tab called Credentials. Under credentials we can create credentials from login. I want to script those credentials not logins.
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2011-12-14 : 11:58:21
This is what we use. You may need to augment it if you're using EKM.[CODE]select
'CREATE CREDENTIAL ' + name + ' WITH IDENTITY = ''' + credential_identity + ''', SECRET = ''<Put Password Here>'';'
from
sys.credentials
order by name;[/CODE]BTW, the SECRET clause is optional so you could probably do without it.

=======================================
Faced with the choice between changing one's mind and proving that there is no need to do so, almost everyone gets busy on the proof. -John Kenneth Galbraith
Go to Top of Page

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2011-12-14 : 12:42:12
Thanks Bustaz, it works. Another question is if I ignore SECRET clauase, how password will be copied? I dropped a credentials, used script created by your select statement and remove secret part, new credential created with password, I don't know from where it copied password. May be this password different from previous.
Go to Top of Page
   

- Advertisement -