SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Backups need more data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

WJHamel
Aged Yak Warrior

USA
644 Posts

Posted - 02/14/2013 :  12:05:20  Show Profile  Reply with Quote
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 - 02/14/2013 :  18:37:26  Show Profile  Reply with Quote
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

USA
644 Posts

Posted - 03/25/2013 :  12:13:44  Show Profile  Reply with Quote
Excellent, we'll give this a try on the next migration.

thanks
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000