2013-07-24 154 views
1

這是SSMS轉換失敗

我試圖插入遵循僞測試報表及其失敗

INSERT INTO Client 
(
    [name], 
    [address], 
    [DOB], 
    [Mobile], 
    [Email], 
    [profession], 
    [refby] 
) 
VALUES 
(
    'Toby Keith', 
    '8 big dog daddy lane oklahoma 40518', 
    '28/06/2010', 
    '0424 280 185', 
    '[email protected]', 
    'Country Superstar', 
    'Willie' 
) 

我得到的消息是:

Msg 241, Level 16, State 1, Line 2 
Conversion failed when converting date and/or time from character string. 

現在我已經用了這麼多次沒有問題什麼小小的愚蠢的東西,我失蹤了?

+0

你運行使用相同的用戶像往常一樣查詢?還是你改變了你的語言設置? – jazzytomato

+0

上帝我是一個白癡我沒有設置日期時間格式 和使用int爲手機號碼,而不是nvarchar! 對不起人們浪費你的時間 – CodeKuga88

回答

0

使用ISO日期時間格式 -

INSERT INTO Client 
(
    [name], 
    [address], 
    [DOB], 
    [Mobile], 
    [Email], 
    [profession], 
    [refby] 
) 
VALUES 
(
    'Toby Keith', 
    '8 big dog daddy lane oklahoma 40518', 
    '20100628', 
    '0424 280 185', 
    '[email protected]', 
    'Country Superstar', 
    'Willie' 
)