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
 Truncated Fields

Author  Topic 

JoshBrigade
Starting Member

28 Posts

Posted - 2009-11-02 : 14:14:42
HI,
I am finding that i can only update upto 8 fields. Anyone know why? I can work around it, but wondered if i'm doing something wrong at the same time.

Server: Msg 8152, Level 16, State 2, Line 1
String or binary data would be truncated.
The statement has been terminated.

WHAT I UPDATE NOW>>>>>>>>>>>>>>>>>>>
update ut
set LastName = uf.LastName,
FirstName = uf.FirstName,
SSN = uf.SSN,
Phone = uf.Phone,
Cleared = uf.Cleared,
Address = uf.Address,
City = uf.City,
Zip = uf.Zip
from Usersbackupoct2309 as ut
join ULchangefromtwo as uf
on uf.UserName = ut.UserName;



WHAT I UPDATE TO GET THE ERROR>>>>>>
update ut
set LastName = uf.LastName,
FirstName = uf.FirstName,
SSN = uf.SSN,
Status = uf.Status,
EmailAddress = uf.EmailAddress,
Phone = uf.Phone,
Department = uf.Department,
NVTGC = uf.NVTGC,
NotificationMethod = uf.NotificationMethod,
DeliveryMethod = uf.DeliveryMethod,
LoanDeliveryMethod = uf.LoanDeliveryMethod,
Staff = uf.Staff,
Cleared = uf.Cleared,
Web = uf.Web,
Address = uf.Address,
Address2 = uf.Address2,
City = uf.City,
State = uf.State,
Zip = uf.Zip,
Country = uf.Country,
SAddress = uf.SAddress,
SAddress2 = uf.SAddress2,
SCity = uf.SCity,
SState = uf.SState,
SZip = uf.SZip,
SCountry = uf.SCountry,
AuthType = uf.AuthType
from Usersbackupoct2309 as ut
join ULchangefromtwo as uf
on uf.UserName = ut.UserName;

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-11-02 : 14:18:17
This means that one of the fields you are trying to update is too small to fit the data you are trying to update it with -- like trying to put 'Georgia' in a field expecting 'GA'

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-02 : 14:30:14
To fix the issue, expand the column to accomodate the larger size or trim the data so that it fits.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

JoshBrigade
Starting Member

28 Posts

Posted - 2009-11-02 : 14:34:43
yes, indeed the state was the only one with that issue.
Go to Top of Page
   

- Advertisement -