用SqlDmo如何对数据库角色设权限 (200分)

  • 主题发起人 antic_ant
  • 开始时间
使用database对象的grant方法可以给角色设置权限。
database1.grant(Privilege,role_name);其中privilege可以用下面的值:
Constant           Value   Description
SQLDMOPriv_AllDatabasePrivs 130944 Grant all database permissions to the users or roles listed
SQLDMOPriv_CreateDatabase   256 Grant the execute permission for the CREATE DATABASE statement
SQLDMOPriv_CreateDefault   4096 Grant the execute permission for the CREATE DEFAULT statement
SQLDMOPriv_CreateFunction  65366 Can create and own UserDefinedFunction objects
SQLDMOPriv_CreateProcedure  1024 Can create and own StoredProcedure objects
SQLDMOPriv_CreateRule    16384 Grant the execute permission for the CREATE RULE statement
SQLDMOPriv_CreateTable    128 Grant the execute permission for the CREATE TABLE statement
SQLDMOPriv_CreateView     512 Grant the execute permission for the CREATE VIEW statement
SQLDMOPriv_DumpDatabase    2048 Grant permission to back up database
SQLDMOPriv_DumpTable     32768 Maintained for compatibility with previous versions of SQL-DMO
SQLDMOPriv_DumpTransaction  8192 Grant permission to back up the database transaction log
 
多人接受答案了。
 
顶部