Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
Scripting out permission for database?
15 posts, Page 1 of 2
1
2
»»
Scripting out permission for database?
Rate Topic
Display Mode
Topic Options
Author
Message
Ranzz
Ranzz
Posted Wednesday, November 14, 2012 9:34 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Thursday, May 09, 2013 11:26 AM
Points: 138,
Visits: 509
Hi All,
moving databases from Prod to new server. And also want to carry forward permissions.
Need help on moving permissions.
thanks in advance.
Post #1384732
Lowell
Lowell
Posted Wednesday, November 14, 2012 9:43 AM
SSChampion
Group: General Forum Members
Last Login: Yesterday @ 8:39 PM
Points: 11,638,
Visits: 27,713
you'll need to get a copy of sp_help_revlogin from microsoft; there are different versions, depending on 2000/2005, maybe even for 2008 and above, i don't quite remember.
assuming you are going to do a backup from Prod and Restore on the new server, you should be good with that...object permissions are stored int eh databases themselves, and the procedure above will carry the correct sids along with it, so that makes it fairly seamless.
don't forget all the other things on production, like certificates, linked servers,
and more; theres a current thread on side by side server migration you might want to peek at:
http://www.sqlservercentral.com/Forums/Topic1384265-391-1.aspx
Lowell
--
There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1384734
Ranzz
Ranzz
Posted Wednesday, November 14, 2012 9:54 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Thursday, May 09, 2013 11:26 AM
Points: 138,
Visits: 509
Thanks for your replay,
If I am doing refresh from PROD to DEV.
I need take a backup script out permissions for a database before restoring in DEV.
and restore the permissions back in DEV, when the refresh is done.
So, I need help in scripting out permissions for a database..
Post #1384743
george sibbald
george sibbald
Posted Wednesday, November 14, 2012 10:25 AM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 12:30 PM
Points: 5,269,
Visits: 11,205
try
this
, exactly what you want.
read the discussion afterwards as well
---------------------------------------------------------------------
Post #1384758
Ranzz
Ranzz
Posted Wednesday, November 14, 2012 2:32 PM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Thursday, May 09, 2013 11:26 AM
Points: 138,
Visits: 509
It did'nt help....
I need help in scripting out permissions for a database.
Please don't say sp_help_revlogin: It gives list out all the logins on a server.
Post #1384868
CapnHector
CapnHector
Posted Wednesday, November 14, 2012 2:34 PM
SSC Eights!
Group: General Forum Members
Last Login: Friday, May 17, 2013 10:07 AM
Points: 935,
Visits: 1,709
User permissions are stored in the database. If i take a backup of MyDatabase and restore it onto a different server all the permissions are going to be the same. the problem comes in when you create users on the new database machine, you will end up with "Orphaned" users in the database. You have two options you can use sp_help_revlogin or you can use ALTER USER
http://msdn.microsoft.com/en-us/library/ms189828.aspx
to map the orphaned users to a SQL Server login. Once you have mapped the Logins to Database users (or using sp_help_revlogin you do not have to go through this step as the SID's of the users will remain the same) all the permissions will be there.
For faster help in answering any problems Please read
How to post data/code on a forum to get the best help - Jeff Moden
for the best way to ask your question.
For performance Issues see how we like them posted here:
How to Post Performance Problems - Gail Shaw
Need to Split some strings?
Jeff Moden's DelimitedSplit8K
Jeff Moden's
Cross tab and Pivots Part 1
Jeff Moden's
Cross tab and Pivots Part 2
Jeremy Oursler
Post #1384869
george sibbald
george sibbald
Posted Wednesday, November 14, 2012 4:15 PM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 12:30 PM
Points: 5,269,
Visits: 11,205
Danzz (11/14/2012)
It did'nt help....
I need help in scripting out permissions for a database.
Please don't say sp_help_revlogin: It gives list out all the logins on a server.
You asked for a script to list database permissions and that is exactly what it does, how did it not help?
---------------------------------------------------------------------
Post #1384918
Ranzz
Ranzz
Posted Thursday, November 15, 2012 8:24 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Thursday, May 09, 2013 11:26 AM
Points: 138,
Visits: 509
sp_help_revlogin : List outs all the logins from the server,
I dont want all the logins.
I just need for a list all the logins in a database:
which include login, roles, grant permissions.
Any help is greatly appreciated..Thanks in advance.
Post #1385195
george sibbald
george sibbald
Posted Thursday, November 15, 2012 8:37 AM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 12:30 PM
Points: 5,269,
Visits: 11,205
have you looked at the link i posted?
---------------------------------------------------------------------
Post #1385204
Lowell
Lowell
Posted Thursday, November 15, 2012 9:22 AM
SSChampion
Group: General Forum Members
Last Login: Yesterday @ 8:39 PM
Points: 11,638,
Visits: 27,713
Georges link again for clarity:
http://www.sqlservercentral.com/scripts/Permissions/76450/
Lowell
--
There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1385238
« Prev Topic
|
Next Topic »
15 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.