I am trying to script my users and here is what i have:
use TestDB
EXEC SP_ADDLOGIN 'testUser', 'testPass', 'TestDB'
EXEC SP_GRANTDBACCESS 'testUser'
EXEC SP_ADDROLEMEMBER 'DB_DATAWRITER', 'testUser'
I don't get any errors - but when i go into Enterprise Manager and click Database Access and the Name of the Database to check to make sure the user has write access i get the following error:
The name 'testUser' was not found in the Users collection. If the name is a qualified name, user [] to sperate various parts of the name, and try again.
Any ideas on what i am doing wrong?
Thanks in advance,
-Bell
use TestDB
EXEC SP_ADDLOGIN 'testUser', 'testPass', 'TestDB'
EXEC SP_GRANTDBACCESS 'testUser'
EXEC SP_ADDROLEMEMBER 'DB_DATAWRITER', 'testUser'
I don't get any errors - but when i go into Enterprise Manager and click Database Access and the Name of the Database to check to make sure the user has write access i get the following error:
The name 'testUser' was not found in the Users collection. If the name is a qualified name, user [] to sperate various parts of the name, and try again.
Any ideas on what i am doing wrong?
Thanks in advance,
-Bell