0

not able to create table in netbeans java connected to MS SQL server

Error- Create table permission denied in database

How can I get the permissions. Please suggests some solutions.

2 Answers 2

1

To create a table your user must have ALTER permission on the target schema and CREATE TABLE permissions on the database. These permissions can be granted by the database owner.

If this SQL Server instance is running on your PC, connect using SSMS with Windows Integrated auth from an elevated session, or using the SA account and grant the target user the rights to create tables. Connected to the target database run

GRANT ALTER ON SCHEMA::DBO TO SomeUser
GRANT CREATE TABLE TO SomeUser

Or to make that user a database-level admin

GRANT CONTROL TO SomeUser
Sign up to request clarification or add additional context in comments.

Comments

0

To create table your login must have db_owner permission. These permissions can be granted by the database owner.

1. Launch "SQL Server Management Studio"
2. Expand <servername> - 'Security' - 'Logins'
3. Double-click on SQL login 'fastnet' // u have to open your created login
4. Inside the section 'Server Roles' ensure that the ONLY options ticked are 'bulkadmin' and 'public'. Do NOT tick any other options.
5. Inside the section 'User Mapping' highlight the your database
6. Ensure that the option 'Map' is ticked
7. Inside the window 'Database role membership for <databasename>' ensure that 'db_owner' and 'public' are ticked. Do NOT tick any other options.
8. Save changes and exit, login again with your login then test.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.