Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easy way to import/export Sql Server 2005 users/permissions across instances?

Is there an easy way to export and then import users/permissions from one Sql Server 2005 instance to another?

like image 312
John Farrell Avatar asked Nov 25 '25 06:11

John Farrell


2 Answers

Might need to do a "sp_change_users_login AUTO_FIX, 'my_user'" afterwards to re-link security logins to their respective data as well.

like image 178
Kolten Avatar answered Nov 26 '25 20:11

Kolten


Use the management console to generate a script for your users and thier associated permissions. Same can be done for the server logins in the security folder.

Select your user: Select DB and expand security\users folder Right Click --> Script User As --> Create To --> New Query

For Logins

Select your Login: Expand security\logins folder Right Click --> Script Login As --> Create To --> New Query

Now just run the query on your new instance. Just choose the db to run the script in.

like image 24
littlechris Avatar answered Nov 26 '25 19:11

littlechris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!