SQL Server User Permissions – How to Grant User Permission to Create Table Without Seeing Other Tables

permissionssql serversql-server-2008sql-server-2008-r2sql-server-2012

We have dealed with an outsource company to install an application for use of our accounting department. Now, they want to access our existing database to install their application but i don't want them to see our current database inside. I mean like tables, stored procedures etc.. How to grant them just to create a table but not to see other structures of our database?

Best Answer

This should do the work. I tested it in my test environment, works for me.

USE [master]
GO
CREATE LOGIN [TestLogin] WITH PASSWORD=N'test', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [TutorialDB]
GO
CREATE USER [TestLogin] FOR LOGIN [TestLogin]
GO
GRANT CREATE TABLE TO [TestLogin];
GO
  1. Create a Login on the server with public role.
  2. Then Create a user on the database that they need to access.
  3. Grant create table to that user.