What are the challenges you face when working across database platforms? Take the survey
Options

Unusual User comparison

jdnepjdnep Posts: 5
edited March 11, 2005 1:36PM in SQL Compare Previous Versions
I am comparing 2 DBs and get the following

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

Comments

  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello,

    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.
This discussion has been closed.