您的位置:首页 > 其它

How to grant a user the access to create a table within new schema

2009-03-18 12:02 931 查看
--How to grant a user the access to create a table in a new schema

use tempdb

go

create login u1 with password = 'Mdfjd$sakj943857l7sdfh##30'

create user u1 with default_schema = u1

go

grant create table to u1

go

create schema sch1

go

create schema u1 authorization u1

go

execute as user = 'u1'

go

create table t1(c1 int)

go

revert

go

select user_name(uid) , * from sysobjects where name = 't1'

go

The following BOL topics is strongly recommened:

· User schema separation (http://msdn2.microsoft.com/en-us/library/ms190387.aspx)

· CREATE TABLE (http://msdn2.microsoft.com/en-us/library/ms174979.aspx)

· ALTER SCHEMA (http://msdn2.microsoft.com/en-us/library/ms173423.aspx)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐