Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Username/Password syntax

Status
Not open for further replies.

jalbao

Programmer
Nov 27, 2000
413
US
I am using sqlserver 2000.
I am creating a database using sql CREATE DATABASE.
What is the syntax for creating a username/password for the newly created database. I am thinking that there is a way to define the username/password in the CREATE DATABASE query.
 
The CREATE DATABASE syntax does not include a CREATE user option. Use sp_grantdbaccess.

EXEC sp_grantdbaccess 'loginname', 'username'

See SQL BOL for more details. Terry

"I'm not dumb. I just have a command of thoroughly useless information." - Calvin, of Calvin and Hobbes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top