I am very new to this. I have created this table and I had no problems doing it:
CREATE TABLE [dbo].[Urban_Rail] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Country] VARCHAR (50) NOT NULL,
[City] VARCHAR (50) NOT NULL,
[Type] VARCHAR (50) NOT NULL,
[Gauge] NCHAR (10) NULL,
[Year] NCHAR (10) NULL,
[Status] VARCHAR (50) NULL,
[Notes] VARCHAR (500) NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);
Now I am trying to fill in few thousand rows of data using this statement:
INSERT INTO Urban_Rail ('Id','Country','City','Type','Gauge','Year','Status','Notes') VALUES ('','Algeria','Algiers','Metro','1435','2011','Open','');
INSERT INTO Urban_Rail ('Id','Country','City','Type','Gauge','Year','Status','Notes') VALUES ('','Algeria','Algiers','Tram','1435','2011','Open','');
INSERT INTO Urban_Rail ('Id','Country','City','Type','Gauge','Year','Status','Notes') VALUES ('','Algeria','Batna','Tram','','','Planned','');
But I get errors saying that the name of each column is not valid. That does not look true to me. I am wondering if it has something to do with the Id instead which is an auto increment identity which I have left without value in my query. What am I doing wrong here? Some help will be appreciated.