Solved

Table create permissions on SQL Server 2005

Posted on 2016-11-30
9
40 Views
Last Modified: 2016-12-01
Hi,

How would I grant create and alter table to a role in SQL Server 2005?  The development team wish to use the Entity Framework in their application and this requires that role has the create and alter table permissions. Any guidance would be appreciated.

Thanks
0
Comment
Question by:Morpheus7
  • 5
  • 4
9 Comments
 
LVL 24

Expert Comment

by:Pawan Kumar
ID: 41907048
Try..

USE YourDBName;  
GRANT CREATE TABLE TO Pawan;  
GO

USE YourDBName;  
GRANT ALTER TABLE TO Pawan;  
GO


Note - Pawan is your user name
0
 

Author Comment

by:Morpheus7
ID: 41907142
Hi,

Many thanks for the response. I have given the role create table permissions, but they are still unable to create a table. I am unable to apply the alter script.

Thanks
0
 
LVL 24

Expert Comment

by:Pawan Kumar
ID: 41907193
This means you do not have access to perform  these operations.

Are you the admin on the SQL Server. Also ask the person to disconnect SSMS and connect again.
0
 

Author Comment

by:Morpheus7
ID: 41907413
Hi,
I am sa on the server. I have asked the user to disconnect and reconnect but the error persists.

Thanks
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 24

Expert Comment

by:Pawan Kumar
ID: 41908323
Can you please provide me the screen shot the current access setting he has ?
0
 

Author Comment

by:Morpheus7
ID: 41908355
Hi,

One thing I have realises is that role that requires access does not have a schema associated with it. Should it have one?

Thanks
0
 
LVL 24

Accepted Solution

by:
Pawan Kumar earned 500 total points
ID: 41908361
Try this..

GRANT ALTER ON SCHEMA::dbo TO UserName

CREATE ROLE PawanPawan
GO

GRANT CREATE TABLE TO PawanPawan
GO

GRANT ALTER ON SCHEMA::dbo TO PawanPawan
GO 

EXEC sp_addrolemember 'PawanPawan', UserName
GO

Open in new window


https://msdn.microsoft.com/en-us/library/ms187940.aspx
http://www.sqlservercentral.com/Forums/Topic1107353-359-1.aspx
0
 

Author Closing Comment

by:Morpheus7
ID: 41908768
That's great, many thanks.
0
 
LVL 24

Expert Comment

by:Pawan Kumar
ID: 41909648
Welcome Morpheus !!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now