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!

I am using TSQL to create a 'LOGIN'

Status
Not open for further replies.

jalbao

Programmer
Nov 27, 2000
413
US
I am using TSQL to create a 'LOGIN' and a 'USER' via

EXEC sp_addlogin 'foo', 'boo', 'loo'
EXEC sp_adduser 'foo', 'foo', 'db_owner';

The sp_addlogin works fine - meaning that when i use Enterprise Manager to view the LOGINS, I can see the new login that was created by my TSQL.

As far as the sp_grantdbaccess is concerned, the TSQL is not adding the USER account - meaning that when I use Enterprise Manager to view the USERS of a specific database, the user account does not appear.

During/After I run the TSQL statement I receive no errors - which makes it difficult for me to figure out why the USER account is not being added.

thanks
 
i figured out my problem - a reply to this post is not necessary.

 
Make sure you are in the proper databse when you execute sp_adduser.

EXEC sp_addlogin 'foo', 'boo', 'loo'
Use mydatabase
Go
EXEC sp_adduser 'foo', 'foo', 'db_owner'
Go
Terry

"I'm not dumb. I just have a command of thoroughly useless information." - Calvin, of Calvin and Hobbes
 
exactly terry - that was what i overlooked.

thanks for the reply
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top