tags:

views:

207

answers:

4

Using SQL Server 2005

I have two table which have the same datatype and datasize, same data's

When i execute my query, I got the result in one table, when i execute the another table i got this error as string or binary data would be truncated error, i checked the datatype size also. Before it was running, am getting this error from two days onwards.

I checked the datatype size also, i modified my datatype upto 256, still it showing error.

How to solve this issue.

+1  A: 

Perhaps it is a different field then the one you suspect.

Jason
A: 

Things I would check:

If the fields size are the same, check for field sequence, i.e.

table1:   Address,City,State,ZipCode
table2:   Address,City,ZipCode,State

Inserting into table 1 from table two would cause the error.

Another possibility is the query might do some sort of concatenation

Sparky
A: 

If the fields are all matched, then is there a trigger on the table that is also involving an additional table which has a column defined that is too short?

David M
+1  A: 

You have to check everything is the same...

  • Correct DB?
  • Correct schema? (eg foo.MyTable and dbo.MyTable)
  • Correct column order?
  • Trigger?
  • Concatenation or some processing?
  • Same data being inserted?

Edit: What was it of my list, out of interest please?

gbn