Re: same user/login for different databases on same instance



dg,

Yes, you have analyzed the problem correctly. So, I am not sure what to tell you to do. You will have to change something about your approach. E.g.

1 - Get 3 SQL Servers, which could mean 3 instances of SQL Server on the same machine. (Providing it can handle the load. Perhaps dev and test could be SQL Server Express.)

2 - Use different logins for each database. (But you already knew that.)

3 - Switch to using an Application Role, which is specific to a database, once your application attaches to the proper database. From that point forward it will be limited to one database. (Separate logins are still better.)
http://msdn.microsoft.com/en-us/library/ms190998(SQL.90).aspx
http://msdn.microsoft.com/en-us/library/ms181491(SQL.90).aspx
http://msdn.microsoft.com/en-us/library/ms188908(SQL.90).aspx

FWIW,
RLF



"db" <db@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:CB3F6C99-4D98-41F0-B36B-C938EFE745F0@xxxxxxxxxxxxxxxx
Hi

I have a new sql server 2005. Ineed to set up test, production and
development databases on the server. Say the database are test, dev, prod.

I need to create same database user "appuser" on all three databases. I need
same user ("appuser" ) but user on test database should not have access to
anything on development or production environment/database.

Before creating database user, I have to create login (sp_addlogin) and this
login is common for all the databases. So I am stuck in the sence I can not
have same user name but different permission for different databases as that
username is associated with login name and loginname have all the
permissions.

Help.

db







--
ontario, canada

.



Relevant Pages

  • Re: System Administrator Implied Permissions
    ... > sa login, it assigns it the System Administrator fixed ... > Now, given this, why does SQL Server ... in each database is always a member of the public and db_owner roles. ... Other sysadmin role members have the exact same ...
    (microsoft.public.sqlserver.security)
  • Re: No db access after publishing web site
    ... GRANT UPDATE TO ... If I detach and attach this database on a different PC (according that PC ... Cannot open database "pago" requested by the login. ... Are you detaching/attaching the SQL Server Express database correctly ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: code access security
    ... Error 1 CREATE ASSEMBLY for assembly 'GmsSqlClr' failed because assembly ... owner has EXTERNAL ACCESS ASSEMBLY permission and the database has the ... make sure the database owner is mapped to the correct login on ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: cannot login to the db after...
    ... Jasper Smith (SQL Server MVP) ... I have created a new database, "db_1", using the "sa" ... I then created a new login, "sqluser1" and gave ...
    (microsoft.public.sqlserver.security)
  • Re: Cant view merge agent properties (trying again)
    ... In the List of Actions for the Snapshot Agent History I see this repeated: ... every single database listed. ... So, just now, I went to computername\Administrator Login ID (because it's ... On the computer running SQL Server, ...
    (microsoft.public.sqlserver.replication)