test1

USE [your_db_name]
GO

DROP USER [zhang.san] GO SELECT N'ALTER AUTHORIZATION ON SCHEMA::' + QUOTENAME(SCH.name) + N' TO [dbo];', * FROM sys.schemas SCH WITH(NOLOCK) INNER JOIN sys.database_principals DP WITH(NOLOCK) ON DP.principal_id = SCH.principal_id WHERE DP.type IN('S', 'G', 'U') AND DP.name = N'zhang.san' -- 要删除的用户 

你可能感兴趣的:(DB)