Friday, March 23, 2012

migrate users

How can I script out existing SQL users from a user database on Production s
erver to the same user databse migrated to Test server ? (Both srv are on w2
k, sql2000)
When I migrate the user database to Test server, I accidentally deleted all
the SQL users for that database on the Test server.
I hve looked at these KB, but not sure if the "logins transfer" will removed
the existing logins or any impact on the Production server,
http://support.microsoft.com/default.aspx?kbid=298897
http://support.microsoft.com/default.aspx?kbid=246133
http://support.microsoft.com/default.aspx?kbid=240872
pls helpHi,
You can script the users and associated roles for that user using the SQL
Server ENterprise manager "Generate SQL script"
1. Open Enterprise manager and connect to the SQL server where your actual
database resides.
2. Expand the datbases and select the database.
3. Right click above the database and choose All tasks and select "Generate
SQL Scripts"
4. Go to Options tab in the new window displayed
5. Check the option "Script database users and database roles"
6. Go back to "General Tab"
7. CLick Preview.. This will display you the database users and roles
assigned
8. copy the script and paste in to a notepad
9. Login to TEST SQL servers Query analyzer using 'SA'
10. Go to the database you have dropped the users
11. copy the notepad contents and paste it in Query analyzer
12. Execute the script... Ensure that you are in correct database.
This will create all the users back with correct previlages.
FYI, I have never tested this steps before.
Thanks
Hari
MCDBA
"pk" <pk@.discussions.microsoft.com> wrote in message
news:AB82B609-55E7-4D10-9344-4ACC87721FA6@.microsoft.com...
> How can I script out existing SQL users from a user database on Production
server to the same user databse migrated to Test server ? (Both srv are on
w2k, sql2000)
> When I migrate the user database to Test server, I accidentally deleted
all the SQL users for that database on the Test server.
> I hve looked at these KB, but not sure if the "logins transfer" will
removed the existing logins or any impact on the Production server,
> http://support.microsoft.com/default.aspx?kbid=298897
> http://support.microsoft.com/default.aspx?kbid=246133
> http://support.microsoft.com/default.aspx?kbid=240872
>
> pls help

No comments:

Post a Comment