Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Insrting Values error

Author  Topic 

gaby_58
Starting Member

33 Posts

Posted - 2011-11-29 : 14:13:09
Hi All,

I have a table with ID as Identity Column and remaining fields with VarChar and Char. When I try to insert value into this table from a code I am getting error as string or binary data would be truncated. Before the Identity column, it was inserting properly, so what should I do as I want the ID column to be auto numbered and remaining fields to be inserted, any tips or suggestions are very much appreciated. Thanks

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2011-11-29 : 14:48:18
It depends on how you have the other columns declared. If it is a varchar(8) and you try to stick in 'ILIKEYAKHEADS', it will fail.
Follow the HOW TO ASK link in my sig, and it will show you how to supply DML and DDL that will help us help you.

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
   

- Advertisement -