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)
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)
相关文章推荐
- How to create a new user and grant permissions on MySql
- How To Create a New User and Grant Permissions in MySQL
- How To Create a New User and Grant Permissions in MySQL
- How to grant access to SQL logins on a standby database when the guest user is disabled in SQL Serve
- How To Create a New User and Grant Permissions in MySQL
- How to Create a site at the specified URL and new database (Command-Line Operation)
- How to Create a User Defined Table
- 104 User SCOTT wants to back out the transactions on the REGIONS table in his schema. As a DBA, whic
- How to create fully custom Role, User, Event, Resource classes for use with the Security and Scheduler modules
- how to close the old Session - if the same username starts a new Session?
- How To Use The New Multivalue Field In Access 2007/2010 Sunday, June 19th, 2011
- How to Create Transportable Tablespaces Where the Source and Destination are ASM-Based
- Unable to open table file ..\data\model_ckpt: Unknown: NewRandomAccessFile failed to Create/Open:
- How to add the selinux policy access for the new created linux file node.
- Understanding Object Ownership in sql 2000(how to change the schema table name in sql 2000)
- How to change the filenames queque to new filenames
- [SharePoint]javascript client object model 获取lookup 类型的field的值,包括user类型(单人或者多人)的值。how to get the multiple user type/lookup type field value by Javascript client object model
- (转载)How to create a mobile WordPress theme with jQuery Mobile
- How to pass a value from User Control to the Page
- how to show error(404) to the user