Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Where to create the login and user account Expand / Collapse
Author
Message
Posted Wednesday, March 24, 2010 10:39 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Wednesday, December 17, 2014 4:09 AM
Points: 761, Visits: 1,083
I need to create a login and a user account in several databases using t-sql
I need to know where (in wich database) to create the login and the user account.


If i have a login like:

CREATE LOGIN test WITH PASSWORD='test'

Do i have to create this having the query window in the master database? or can the query window be connected to other database (e.g a user database).

What about the account:

USER test FOR LOGIN test WITH Default_schema=dbo


Should the query window of MS be connected to the master database or to the user database?

Thank you







Post #889125
Posted Wednesday, March 24, 2010 12:06 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 6:20 AM
Points: 6,752, Visits: 14,400
river1 (3/24/2010)
I need to create a login and a user account in several databases using t-sql
I need to know where (in wich database) to create the login and the user account.


If i have a login like:

CREATE LOGIN test WITH PASSWORD='test'

Do i have to create this having the query window in the master database? or can the query window be connected to other database (e.g a user database).

What about the account:

USER test FOR LOGIN test WITH Default_schema=dbo


Should the query window of MS be connected to the master database or to the user database?

Thank you


doesnt matter for the create login as they are always created in master anyway. For the Create user you need to specify a USE for the database you want the user created in


-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs"
Post #889224
Posted Thursday, March 25, 2010 2:27 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Wednesday, December 17, 2014 4:09 AM
Points: 761, Visits: 1,083
Thank you very much Perry
Post #889601
Posted Thursday, March 25, 2010 7:16 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 6:20 AM
Points: 6,752, Visits: 14,400
No problem, glad i could help!

-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs"
Post #889783
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse