Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grant Permission to CREATE tables - SQL Server

Tags:

What is the SQL command for giving a user permissions to create (and delete) tables? I am looking for something similar to this:

GRANT INSERT, UPDATE, SELECT ON Customers TO Joe

I have spent some time Googling for the answer.

like image 572
w0051977 Avatar asked Mar 27 '14 15:03

w0051977


People also ask

How do I grant permission to all tables in SQL?

Launch SQL Server Management Studio and connect with credentials that have been granted the 'sa' role. Expand Security, right-click on Logins and select New Login. Enter a descriptive Login name, select SQL Server authentication, and enter a secure password.


2 Answers

When I googled, I got right to TechNet. It looks like you want:

GRANT CREATE TABLE

As in:

USE AdventureWorks2012;
GRANT CREATE TABLE TO MelanieK;
GO
like image 129
Karl Kieninger Avatar answered Sep 30 '22 10:09

Karl Kieninger


Two Options

  1. GRANT CREATE TABLE TO Joe AS dbo
  2. Add the user to the fixed database role: db_ddladmin
like image 36
Eelco Drost Avatar answered Sep 30 '22 10:09

Eelco Drost