开发者

String or binary data would be truncated

I am trying to execute the following SQL query using MS SQL Server Management Studio express.开发者_运维技巧

 Insert INTO SU_PRO_RE ( d_id, fis_year, last_dp, budget_amt)  VALUES ( 'A','2011', 0, 205000.00);

Everything looks correct to me but every time i try to execute it it has the following:

String or binary data would be truncated.
The statement has been terminated.

(0 row(s) affected)

The tables as set as follows:

d_id        = char(1) *PK*
fis_year    = char(2) *PK*
last_dp     = smallint
budget_amt  = money

I'm not sure what i am doing incorrect but i'm sure i am just over looking something very obvious so any help would be great! :)

Thanks, David


fis_year is defined as char(2) but you're trying to insert a 4 character value of '2011'.


Well, the field fis_year is defined as CHAR(2), and you are trying to insert a value that has 4 charachters long.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜