2013-07-24 152 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' 
)