how to script-wise grant access privilege to a user

how to script-wise grant access privilege to a user

Post by Charles Y » Sat, 27 Oct 2001 08:00:21



I tried to use
 use targetDB

to grant to xuser access to targetDB.

But it didn't work, and I couldn't find a programming (or
script-wise) way to grant a special privilege such as DDL,
DML, or read to a certain user for a certain db.

Can this be done in server2000, and how?

Thanks in advance,

-charles
.

 
 
 

how to script-wise grant access privilege to a user

Post by Pat Phela » Sat, 27 Oct 2001 14:15:28


If you execute the T-SQL command:

EXECUTE sp_grantdbaccess 'xuser'

You will give the login "xuser" access to the current database (implicitly as the database user "xuser").  Note that this means the login xuser can USE the database, but it does not give them any permissions to do *anything* with the objects (tables, procedures, etc) in that database.

-PatP

========================================

Please post DDL at the very least, and DML when possible to make it easier for people to help you.

Please reply only via newsgroups, as I rarely reply to email.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

 
 
 

1. how to script-wise grant special database access to a user

I tried to use
 use targetDB

to grant to xuser access to targetDB.

But it didn't work, and I couldn't find a programming (or
script-wise) way to grant a special privilege such as read
or write to a certain user for a certain db.

Can this be done in server2000, and how?

Thanks in advance,

-charles

2. TTables or Am I going MAD??

3. Grant all Object Privilege from User to User

4. How to prevent from changing any data posted.

5. Granting a database user SA privileges

6. Recordset sort order

7. How to grant SYSDBA privilege to user?

8. FW: Update table from another table

9. granting privileges on other user

10. does granting privileges to a role automatically cascade to users

11. Grant privileges using SYS user.......