Unusual User comparison
jdnep
Posts: 5
I am comparing 2 DBs and get the following
LEFT
RIGHT
I wanted to know where SQL Compare is looking to compare this User. Also, why is the sp_grantdbaccess on the right have dual parms? I just don't understand the process
Thanks
LEFT
-- User
if not exists (select * from master.dbo.syslogins where loginname = N'HRUserTest')
exec sp_addlogin N'HRUserTest', 'test'
GO
sp_grantdbaccess N'HRUserTest'
GO
RIGHT
-- User
if not exists (select * from master.dbo.syslogins where loginname = N'HRUserTest')
exec sp_addlogin N'HRUserTest', 'test'
GO
sp_grantdbaccess N'HRUserTest', N'HRUserTest'
GO
I wanted to know where SQL Compare is looking to compare this User. Also, why is the sp_grantdbaccess on the right have dual parms? I just don't understand the process
Thanks
This discussion has been closed.
Comments
There are two parameters for a SQL login. The first is the login name, which you create under security. The second is the 'name in database'. If the name is database is left blank, it defaults to the security login name. To SQL Compare, however, if the name in database was specified when the user was created, it will be shown as a difference.
Please let us know if you have any more questions.