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 Newbies
»
comparsion of users between two servers
comparsion of users between two servers
Rate Topic
Display Mode
Topic Options
Author
Message
DBA_Learner
DBA_Learner
Posted Wednesday, January 11, 2012 9:39 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: 2 days ago @ 2:37 PM
Points: 170,
Visits: 388
Can we compare users between two servers, for ex: users in production and test environments to see users in the Test Environment that are not in production and inactive Production users that are active in the Test environment.
Post #1234131
azdzn
azdzn
Posted Wednesday, January 11, 2012 9:56 AM
UDP Broadcaster
Group: General Forum Members
Last Login: Tuesday, April 30, 2013 12:46 PM
Points: 1,493,
Visits: 239
Sure you can, but you have a little work to do.
This query lists users per database :
sp_MSForeachdb '
USE ?
select
db_name() as dbname
, sp.name as login
, dp.name as [user]
from sys.database_principals dp
inner join sys.server_principals sp on sp.principal_id = dp.principal_id
WHERE dp.type_desc = ''SQL_USER''
'
Run it on your test and prod server and then :
- compare with Excel for eample
- import your prod users to your dev server (you will have to store the results in a table and then use Import Data wizard in Management Studio)
and compare with a FULL JOIN
Post #1234156
spaghettidba
spaghettidba
Posted Wednesday, January 11, 2012 10:42 AM
SSCarpal Tunnel
Group: General Forum Members
Last Login: Thursday, May 16, 2013 8:29 AM
Points: 4,804,
Visits: 8,067
Another option: use a linked server.
Get your two-cent-answer quickly
The Spaghetti DBA
Post #1234195
Jack Corbett
Jack Corbett
Posted Thursday, January 12, 2012 8:41 AM
SSChampion
Group: General Forum Members
Last Login: 2 days ago @ 12:22 PM
Points: 10,571,
Visits: 11,871
A third option is to use PowerShell. I'm not a PowerShell guy myself, but I think this is an excellent scenario for using it.
Jack Corbett
Applications Developer
Don't let the good be the enemy of the best. --
Paul Fleming
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #1234897
DBA_Learner
DBA_Learner
Posted Friday, January 13, 2012 9:40 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: 2 days ago @ 2:37 PM
Points: 170,
Visits: 388
Thank you.
Post #1235802
DBA_Learner
DBA_Learner
Posted Friday, January 13, 2012 9:40 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: 2 days ago @ 2:37 PM
Points: 170,
Visits: 388
Is it a good Idea to link Production server to Test server?
Post #1235803
spaghettidba
spaghettidba
Posted Friday, January 13, 2012 9:45 AM
SSCarpal Tunnel
Group: General Forum Members
Last Login: Thursday, May 16, 2013 8:29 AM
Points: 4,804,
Visits: 8,067
Maybe not, but you could always do it the other way round.
Get your two-cent-answer quickly
The Spaghetti DBA
Post #1235807
« Prev Topic
|
Next Topic »
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.