可以說我有像繩子下面如何從SQL Server中的字符串插入日期時間
string dt = "2/14/2014 11:59:59 PM";
現在我想在SQL Server 2012 我對下面的查詢
INSERT INTO Some_Info(date_colm1,date_colm2) VALUES(CONVERT(datetime, '2/14/2014 11:59:59 PM'),CONVERT(datetime, '2/14/2014 11:59:59 PM'));
試圖插入此
我越來越像輸出下面
Conversion failed when converting date and/or time from character string.
似乎是什麼問題?我錯過了什麼?
從哪個來源獲得該數據? –
哪些是你的列的數據類型?我懷疑他們是'date'而不是'datetime'。 –
@HamletHakobyan數據類型是datetime! –