Skip to content

Instantly share code, notes, and snippets.

@jrichardsz
Last active June 3, 2024 18:05
Show Gist options
  • Save jrichardsz/f65b3abb9657a39efaba52a4d7f4e5f6 to your computer and use it in GitHub Desktop.
Save jrichardsz/f65b3abb9657a39efaba52a4d7f4e5f6 to your computer and use it in GitHub Desktop.
sql server snippets, sqlserver

Create database, user able to login using [SQL Server Authentication mode]

USE [master]
CREATE DATABASE UmbrellaEnterprises
GO
USE [UmbrellaEnterprises]
CREATE LOGIN support_team_login WITH PASSWORD = 'P@ssW0rd';
CREATE USER support_team_usr FOR LOGIN support_team_login;
EXEC sp_addrolemember N'db_owner', N'support_team_usr'

image

Notes

  • Remember to use the login not the user to login
  • You could set the same value in login and user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment