标签: sql sql-server
我想将用户添加到数据库, 但数据库处于只读模式,
此处TestDB处于只读模式,
USE [TestDB]; IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = ''' +@username+''') CREATE USER ['+ @username +'] FOR LOGIN ['+ @username +']; END;