2017-01-08 50 views
1

這是我創建的表,我想插入值在它插入到表中的值(INT,INT,時間,時間)在SQL Server

Create Table JunctionRS(
id_r int foreign key references Rute(id_r), 
id_s int foreign key references Statii(id_s), 
constraint id_j primary key (id_r,id_s), 
arrival time, 
departure time); 




insert into JunctionRs values(1 , 2 , 21:45:00 ,22:00:00); 
+1

你必須單引號你的時間 – scsimon

回答

0

添加一些報價,以你的時間

insert into JunctionRS values(1 , 2 , '21:45:00','22:00:00'); 
+0

謝謝戈登。在手機上的自動更正發生故障,我沒有抓住它。 – scsimon

+0

感謝您的回答,我不知道我必須把它寫成varchar – Esan

+0

不用擔心@Esan。一般而言,您需要引用任何不能被視爲數字的內容 – scsimon