Last active
December 20, 2017 15:45
-
-
Save mmacphail/cd63fd52a86742577d39deda0403e856 to your computer and use it in GitHub Desktop.
Remove a table from SQL Server and remap user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use master | |
ALTER DATABASE [db] SET SINGLE_USER WITH ROLLBACK IMMEDIATE | |
IF EXISTS (SELECT * FROM sysdatabases WHERE name=N'db' ) DROP DATABASE [db] | |
create database db | |
use elis_work | |
create user user from login user | |
exec sp_addrolemember 'db_owner', 'user' | |
ALTER DATABASE [db] SET MULTI_USER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment