日期:2014-05-17 浏览次数:20576 次
USE master
GO
IF db_id('test_login')IS NOT NULL
DROP DATABASE test_login
CREATE DATABASE test_login
GO
CREATE LOGIN test_login WITH PASSWORD='123'
GO
USE [master]
GO
ALTER LOGIN [test_login] WITH DEFAULT_DATABASE=[test_login], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=ON
GO
USE [test_login]
GO
CREATE USER [test_login] FOR LOGIN [test_login]
GO
USE [test_login]
GO
ALTER ROLE [db_datareader] ADD MEMBER [test_login]
GO
USE [test_login]
GO
ALTER ROLE [db_datawriter] ADD MEMBER [test_login]
GO
USE test_login
go
CREATE TABLE test_login(id INT)
DENY DELETE TO test_login