--襦蠏語 USE master; IF EXISTS (SELECT * FROM sys.server_principals WHERE name = 'yasicom') DROP LOGIN yasicom; CREATE LOGIN yasicom WITH PASSWORD = 'pw1234!@#$' , DEFAULT_DATABASE = tempdb , CHECK_EXPIRATION = OFF , CHECK_POLICY = OFF; GO
--ろる USE tempdb; IF EXISTS(SELECT * FROM sys.schemas WHERE name = 'TestSchema') DROP SCHEMA PubDiv; GO CREATE SCHEMA TestSchema GO --alter schema dbo transfer ABC.TableAAA
-- IF EXISTS(select * from sys.database_principals WHERE name = 'yasicom') DROP USER yasicom; GO CREATE USER yasicom FOR LOGIN yasicom WITH DEFAULT_SCHEMA = TestSchema; GO --蟠覿 GRANT SELECT ON SCHEMA::TestSchema TO yasicom; GO /* DB 蟆曙 EXEC sp_addrolemember 'db_owner', '覈' GO */