Skip to content
Advertisement

Creating a table Sql Server [closed]

How to create SQL Server tables with 5 columns:

1 IdP column name. 2,3,4,5 column name: a / b / c / d

Features:

  • 1 column (int) is to have 450 rows, with IdP numbered from 1 to 450.

  • The 2nd column (time) is to have a default value of 08:00:00

  • 3rd column (int) default = 1

  • 4th column (int) default = 0

  • 5 column (int) default = NULL

I have

Error:

Incorrect syntax near object “:”.

Advertisement

Answer

Check with supplying time value as shown below. Here is the time (Transact-SQL) reference in SQL Server.

Time and date values are supplied in the single quote. Also table name should be different not the reserved keyword and it is just a suggestion.

Here is the Demo Link.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement