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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

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

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

Aged Yak Warrior

651 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?

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.

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

Aged Yak Warrior

651 Posts

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

Go to Top of Page
  Previous Topic Topic Next 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.04 seconds. Powered By: Snitz Forums 2000