我有場:問題與SQL Server smalldatetime的插入查詢
APP_DATE (smalldatetime)
我在做這個查詢:
INSERT INTO table (TYPE, CODE, APP_DATE, DATE) VALUES ('APP', '123', '02/10/2010 12.30', GETDATE())
它失敗:
Msg 296, Level 16, State 3, Line 1
Conversion from datatype char to smalldatetime generated a value not between the interval of valid values.
Instruction has been interrupted.
(0 row(s) affected)
我在做什麼錯誤?在我看來,作爲該領域的正確格式..
謝謝您的時間。
編輯:SQL Server 2000中
仍然沒有工作: '02/19/2010 16:28'< - 相同的錯誤 – 0plus1 2010-02-23 15:00:13
@ 0plus1:工作對我來說很好..... – 2010-02-23 15:14:34
啊,我有SQL Server 2005.也許這就是問題所在。嘗試更改日期的格式,也許'2010-19-02 16:28'?或許你已經得到了錯誤的區域設置,它認爲19月份? – 2010-02-23 15:17:42