[Solved] SQL Server 2012 Can’t create any table [closed]

Introduction

This article provides a solution to the issue of not being able to create any tables in SQL Server 2012. It explains the cause of the issue and provides a step-by-step guide on how to resolve it. It is important to note that this issue can occur due to a variety of reasons, so it is important to follow the steps outlined in this article to ensure that the issue is resolved.

Solution

If you are unable to create any table in SQL Server 2012, it is likely due to a lack of permissions. To resolve this issue, you will need to grant the appropriate permissions to the user account that is attempting to create the table.

To do this, open SQL Server Management Studio and connect to the server. Then, right-click on the server name and select Properties. Select the Permissions page and add the user account that is attempting to create the table. Make sure to grant the user the appropriate permissions, such as CREATE TABLE, ALTER TABLE, and DROP TABLE.

Once the permissions have been granted, the user should be able to create tables in SQL Server 2012.


Yes, the wrong part is AUTO_INCREMENT. there is no AUTO_INCREMENT in SQL Server. It should be IDENTITY.

Again, you are trying to create two IDENTITY field in your table. that’s not allowed. You can have only one IDENTITY field.

start and end are reserve word. You need to escape them using [] (square brackets)

You CREATE statement should look like

create table course (c_id int not null IDENTITY, r_id int not null , 
[start] date,
[end] date, 
name varchar(20), 
leader int, 
constraint pk_cousrse primary key (c_id, r_id, leader)
)

2

solved SQL Server 2012 Can’t create any table [closed]



Solved: SQL Server 2012 Can't Create Any Table

If you are having trouble creating tables in SQL Server 2012, there are a few things you can try to resolve the issue.

1. Check the permissions of the user account you are using to connect to the database. Make sure the user has the necessary permissions to create tables.

2. Make sure the database is not in read-only mode. If it is, you will not be able to create tables.

3. Check the database for any errors. You can do this by running the DBCC CHECKDB command.

4. Make sure the database is not in single-user mode. If it is, you will not be able to create tables.

5. Make sure the database is not in recovery mode. If it is, you will not be able to create tables.

6. Make sure the database is not in suspect mode. If it is, you will not be able to create tables.

7. Make sure the database is not in emergency mode. If it is, you will not be able to create tables.

8. Make sure the database is not in read-only mode. If it is, you will not be able to create tables.

9. Make sure the database is not in offline mode. If it is, you will not be able to create tables.

10. Make sure the database is not in restricted user mode. If it is, you will not be able to create tables.

If you have tried all of the above steps and still cannot create tables in SQL Server 2012, you may need to contact Microsoft Support for further assistance.