error, string or binary data would be truncated when trying to insert
error, string or binary data would be truncated when trying to insert
(OP)
I am running data.bat file with the following lines:
Rem Tis batch file will populate tables
cd\program files\Microsoft SQL Server\MSSQL
osql -U sa -P Password -d MyBusiness -i c:\data.sql
The contents of the data.sql file is:
insert Customers
(CustomerID, CompanyName, Phone)
Values('101','Southwinds','19126602729')
there are 8 more similar lines for adding records.
when I run this in actually start > run > cmd > c:\data.bat
I get this error message:
1>2>3>4>5>....<1 row affected>
Msg 8152, Level 16, State 4, Server SP1001, Line 1
string or binary data would be truncated.
<1 row affected>
<1 row affected>
<1 row affected>
<1 row affected>
<1 row affected>
<1 row affected>
also , I am a newbee obviously, but what dowa Level #, and state# mean. and how do I look up error messages such as the one above: 8152???
Thanks in advance!!!
Rem Tis batch file will populate tables
cd\program files\Microsoft SQL Server\MSSQL
osql -U sa -P Password -d MyBusiness -i c:\data.sql
The contents of the data.sql file is:
insert Customers
(CustomerID, CompanyName, Phone)
Values('101','Southwinds','19126602729')
there are 8 more similar lines for adding records.
when I run this in actually start > run > cmd > c:\data.bat
I get this error message:
1>2>3>4>5>....<1 row affected>
Msg 8152, Level 16, State 4, Server SP1001, Line 1
string or binary data would be truncated.
<1 row affected>
<1 row affected>
<1 row affected>
<1 row affected>
<1 row affected>
<1 row affected>
also , I am a newbee obviously, but what dowa Level #, and state# mean. and how do I look up error messages such as the one above: 8152???
Thanks in advance!!!
I was the first American Soldier to put a basketball hoop up in Iraq, only to have it stolen by a soldier from different camp. Newbee - Adam
RE: error, string or binary data would be truncated when trying to insert
string or binary data would be truncated
Think to yourself... The field is NOT big enough to hold my data.
Check the table structure for the customers table. I think you'll find that the length of one or more fields is NOT big enough to hold the data you are trying to insert. For example, if the Phone field is a varchar(8) field, and you try to put 11 characters in to it, you will get this error.
-George
Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
RE: error, string or binary data would be truncated when trying to insert
I was the first American Soldier to put a basketball hoop up in Iraq, only to have it stolen by a soldier from different camp. Newbee - Adam
RE: error, string or binary data would be truncated when trying to insert
I suggest you make the BOL your friend, you can find lots of your answers there.
BOL=Books OnLine=Microsoft SQL Server's HELP
Installed as part of the Client Tools
Found at Start>Programs>Microsoft SQL Server>Books OnLine
or online at:
http://ms
Look up error messages in the BOL or on Microsoft's SQL Server website.
-SQLBill
Posting advice: FAQ481-4875
RE: error, string or binary data would be truncated when trying to insert
I was the first American Soldier to put a basketball hoop up in Iraq, only to have it stolen by a soldier from different camp. Newbee - Adam