Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Grant Owner ship etc

Author  Topic 

studyy
Starting Member

16 Posts

Posted - 2010-06-09 : 07:19:54
Hi

I m Trying to find the syntax for creating database & assign user with required permission

I took below code from net & changed for my server



Create Database GetStarted

On Primary

(NAME = 'GetStartedDB_dat',

FILENAME = 'E:\MS_DFiles\getstarteddb.ldf',

SIZE = 5MB,

MaxSize=25MB,

FILEGrowth= 10%)

LOG ON

(NAME='GetStartedDB_log',

FILENAME = 'E:\MS_Log\getstarteddb.ldf',

SIZE = 1MB,

MaxSize=5MB,

FILEGrowth= 10%)

GO

Create Schema GetStartedsch

Create Table EmployeeSummary

(EmpID int Identity(1,1) Primary Key,

EmployeeFirstName varchar(50),

EmployeeLastName varchar(50),

EmployeeBirthDate smalldatetime,

EmployeeNumberofChildren int,

EmployeeBankBalance Money)

GO

CREATE LOGIN LetMeStart

WITH PASSWORD = 'Pass007'

USE GetStarted

CREATE USER LetmestartU FOR LOGIN LetMeStart

WITH DEFAULT_SCHEMA = GetStartedsch





USE GetStarted;
GRANT CREATE TABLE,CREATE VIEW,EXECUTE, ALTER,Select,Insert, Update TO LetmestartU;
GO


Now the problem is that when i log in as "LetMeStart"
I m unable to create new table from Micorsoft management studio (Right click - > New Table)
IT says that i need to be dbowner to create new one.

But i m abler to run query to create table .

So whats i m missing ?

I want that user is able to create table , view , procedure ,alter , update,select through MMS

I read the msdn ref & search google but unable to find solution.


Thanks
Thanks

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2010-06-09 : 20:10:52
GRANT CREATE TABLE,CREATE VIEW,EXECUTE, ALTER,Select,Insert, Update TO LetmestartU;

Is the "U" at the end intentional?

=======================================
A couple of months in the laboratory can save a couple of hours in the library. -Frank H. Westheimer, chemistry professor (1912-2007)
Go to Top of Page

studyy
Starting Member

16 Posts

Posted - 2010-06-13 : 10:54:52
no

its just to show different from login name,

U means user
Go to Top of Page

studyy
Starting Member

16 Posts

Posted - 2010-06-20 : 06:25:14
Bump
Go to Top of Page
   

- Advertisement -