Skip to content

Instantly share code, notes, and snippets.

@HeLiBloks
Last active January 20, 2016 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HeLiBloks/72b62b9d9029a11e5bd7 to your computer and use it in GitHub Desktop.
Save HeLiBloks/72b62b9d9029a11e5bd7 to your computer and use it in GitHub Desktop.
SQL_SERVER snipSnap
--GRANT ALL SQL SERVER
USE master;
go
use [the db];
CREATE LOGIN theUser WITH PASSWORD = 'ComplexPassword01';
CREATE USER theUser FOR LOGIN theUser;
GRANT BACKUP DATABASE, BACKUP LOG, CREATE DEFAULT, CREATE FUNCTION, CREATE PROCEDURE, CREATE RULE, CREATE TABLE, CREATE VIEW,CREATE DATABASE,CONTROL,ALTER
TO heli
USE [the db]
GRANT BACKUP DATABASE, BACKUP LOG, CREATE DEFAULT, CREATE FUNCTION, CREATE PROCEDURE, CREATE RULE, CREATE TABLE, CREATE VIEW
TO theUser
USE master
GO
GRANT CREATE DATABASE
TO theUser
DROP LOGIN theUser
DROP USER theUser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment