I'm new to sql server since this is the requirement of my client. I can't insert because of the error I'm getting regarding the smalldatatime. What's wrong with my query? I have tried everything but still it gives me error.
Here are the things I tried:
SET IDENTITY_INSERT table1 ON
INSERT INTO table1
(id, timelog) values
(1, 2018-07-24 06:30:50.000)
SET IDENTITY_INSERT table1 OFF
ERROR I GOT:
Msg 102, Level 15, State 1, Line 5 Incorrect syntax near '06'.
SET IDENTITY_INSERT table1 ON
INSERT INTO table1
(id, timelog) values
(1, '2018-07-24 06:30:50.000')
SET IDENTITY_INSERT table1 OFF
ERROR I GOT:
Msg 206, Level 16, State 2, Line 2 Operand type clash: int is incompatible with date
SET IDENTITY_INSERT table1 ON
INSERT INTO table1
(id, timelog) values
(1, 2018-07-24T06:30:50.000)
SET IDENTITY_INSERT table1 OFF
ERROR I GOT:
Msg 102, Level 15, State 1, Line 5 Incorrect syntax near 'T06:'