Create User from a different DB in SQL Server
sql-server, t-sql
Solution
You either need to change the context to that database or dynamically go there:
EXEC j_test..sp_executesql N'DROP USER test_user;';
Problem
Is there any way I can create a user on a database from the master DB(or any other DB) ``` IF EXISTS (SELECT 1 FROM j_test.sys.database_principals WHERE name = N'test_user') DROP USER j_test.[test_user]; --doesnt't work. ```