SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Grant Owner ship etc
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

studyy
Starting Member

16 Posts

Posted - 06/09/2010 :  07:19:54  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
1643 Posts

Posted - 06/09/2010 :  20:10:52  Show Profile  Reply with Quote
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 - 06/13/2010 :  10:54:52  Show Profile  Reply with Quote
no

its just to show different from login name,

U means user
Go to Top of Page

studyy
Starting Member

16 Posts

Posted - 06/20/2010 :  06:25:14  Show Profile  Reply with Quote
Bump
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000