all groups > sql server programming > may 2005 >
You're in the

sql server programming

group:

Avoiding truncate error


Avoiding truncate error Romano Benedetto
5/5/2005 6:53:40 PM
sql server programming:
There is some option in Sql Server 2000 to set of avoid errors when a text
larger than destination field is stored in it ?

For example i must do an INSERT INTO NAMES

and NAMES have a field of size 10

if i store a field of size 20 in it the server give me an error

can i avoid this error and store only the firsts 10 bytes in the destination
field?

thanks a lot.

Re: Avoiding truncate error Jens Süßmeyer
5/5/2005 9:02:28 PM
Look in BOL for SET ANSI_WARNINGS with the example




"Romano Benedetto" <RomanBe@tin.it> schrieb im Newsbeitrag
news:UYtee.1336790$35.49871941@news4.tin.it...
[quoted text, click to view]

Re: Avoiding truncate error Jens Süßmeyer
5/5/2005 9:03:02 PM
Look in BOL for SET ANSI_WARNINGS with the example


PRINT 'Testing String Overflow in INSERT'
GO
INSERT INTO T1 VALUES (4, 4, 'Text string longer than 20 characters')
GO

HTH, Jens Suessmeyer.

---
http://www.sqlserver2005.de
---

"Romano Benedetto" <RomanBe@tin.it> schrieb im Newsbeitrag
news:UYtee.1336790$35.49871941@news4.tin.it...
[quoted text, click to view]

AddThis Social Bookmark Button