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
 General SQL Server Forums
 New to SQL Server Administration
 Backups need more data

Author  Topic 

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2013-02-14 : 12:05:20
so a complaint comes my way that, when we're backing up application databases, that the backups are not capturing additional needed data such as user accounts, permission, DTS information. In most cases, these application database backups are restored to new servers with new SQL 05 or 08R2 instances. What suggestions are there for capturing the additional data needed when we run these backups? I'm guessing a "generate scripts" option on the database and generating those scripts for the needed objects and then packaging those up in an SSIS package to restore before the db's are restored to the new machine? yes/no?

srimami
Posting Yak Master

160 Posts

Posted - 2013-02-14 : 18:37:26
You have to run another script to capture this information when you restore your backup's.

SET NOCOUNT ON
SELECT 'EXEC sp_addlogin @loginame = ''' + loginname + ''''
,', @defdb = ''' + dbname + ''''
,', @deflanguage = ''' + language + ''''
,', @encryptopt = ''skip_encryption'''
,', @passwd ='
, cast(password AS varbinary(256))
,', @sid ='
, sid
FROM syslogins
WHERE name NOT IN ('sa')
AND isntname = 0


Execute each record of the above script in a separate session to retain all users with their existing passwords.

Go to Top of Page

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2013-03-25 : 12:13:44
Excellent, we'll give this a try on the next migration.

thanks
Go to Top of Page
   

- Advertisement -