Create user and assign permission to user in LocalDB in Visual Studio

扶醉桌前 提交于 2019-11-30 13:57:33
  • Open SQL Server Object Explorer (e.g. from the Visual Studio View menu)
  • Expand your localdb instance in the tree (e.g. (localdb)\MSSQLLocalDB)
  • Right click your database and select New Query...
  • Execute the following sql:

...

CREATE LOGIN [SomeUser] WITH PASSWORD = 'topsecret';
CREATE USER [SomeUser] FOR LOGIN [SomeUser];
exec sp_addrolemember 'db_owner', 'SomeUser'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!