Quantcast
Channel: SQL Server Manageability forum
Viewing all articles
Browse latest Browse all 1519

Users, Master or Specific Catalog

$
0
0

i was wondering what is the difference between attaching a catalog user to Login on Master catalog or to a specific Catalog,

is it so that if i add user to master catalog would this user be applied to all catalogs of that instance?

i ask that simply because this query:

USE some_catalog

CREATE USER some_user_name FOR LOGIN some_login 

will result in error if "some_user_name" exists already in the "master" catalog

but the query:

IF EXISTS (SELECT name FROM some_catalog.sys.database_principals WHERE name= N'some_user_name')
  SELECT 1;
ELSE
  SELECT 0;

will as expected return 0 if the user is on "master" catalog


Viewing all articles
Browse latest Browse all 1519

Latest Images

Trending Articles



Latest Images