SQL Server Security
Hi,
DROP TABLE needs ALTER permission on the schema to which the table belongs, CONTROL permission on the table, or
membership in the db_ddladmin fixed database role.
USE dbname
GRANT ALTER ON OBJECT :: tablename TO username;
GO;
CU
tosc
DROP is not a grantable permission.
People who can drop a table are:
The dbo
The owner of the schema
The owner of the table (usually the schema owner but it can be changed to someone else)
members of the db_ddladmin fixed database role
members of the db_owner fixed database role
members of the sysadmin fixed server role
grantees of the CONTROL permission on the table or permissions that imply control on the table
grantees of the ALTER permission on the schema or permissions that imply alter on the schema.
hth,
-Steven Gott
S/DET
SQL Server
tosc wrote:
Hi,
DROP TABLE needs ALTER permission on the schema to which the table belongs, CONTROL permission on the table, or
membership in the db_ddladmin fixed database role.
USE dbname
GRANT ALTER ON OBJECT :: tablename TO username;
GO;
CU
tosc
Steven Gott - MS wrote:
grantees of the CONTROL permission on the table or permissions that imply control on the table
this will never work:
"GRANT DROP TABLE TO username"
because DROP is not grantable.
This will work:
USE dbname
GRANT CREATE TABLE TO username
EXECUTE AS USER = 'username'
go
CREATE TABLE T1 (c1 int)
go
REVERT
go
GRANT CONTROL ON tablename TO username
EXECUTE AS USER = 'username'
go
DROP TABLE T1
go
REVERT
go
hth,
-Steven Gott
S/DET
SQL Server