ERROR: String o binary data would be truncated

  • Hi everybody, I have a table 'CJ_REG01' that is loaded everyday and I have a SP 'GDAT_0053B' that execute everyday and sometimes when insert data in a table #tmp from CJ_REG01, show this error:

    Msg 8152, Sev 16: String or binary data would be truncated. [SQLSTATE 22001]

    Msg 3621, Sev 16: The statement has been terminated. [SQLSTATE 01000]

    But when after execute only the part of script(attached to this topic) of SP, run without errors.. Why show this error sometimes?

    P.D: I'm attaching part of script of SP that generate the error.

  • It because you're trying to put something too big into a column too small. It usually means there's an error in the file... might be a transmission error or the folks providing the data are providing data consistent with whatever spec they gave you.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (7/11/2008)


    It because you're trying to put something too big into a column too small. It usually means there's an error in the file... might be a transmission error or the folks providing the data are providing data consistent with whatever spec they gave you.

    Or they stuffed up and sent a file with garbage in it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Oh, I love those words! "Stuffed up"... I've got an Irish friend at work who says they "buggered it up"... if people only know how nasty those words really were. 😛

    It's like, I wonder how many people know what a "Dog and Pony Show" really is?

    Anyway... I made a typo in my previous... I meant to say that the data provider is NOT providing data in a manner consistent with their spec... ie. they "Stuffed up". 😀

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (7/12/2008)


    It's like, I wonder how many people know what a "Dog and Pony Show" really is?

    Many years ago I actually asked some executives at the one of the world's largest companies, about the inappropriate roots of this phrase that they frequently used. I was informed in no uncertain terms that it referred to a circus act (dogs riding on ponies, jumping though hoops, etc.) and had nothing whatsoever to do with Tijuana. :hehe:

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Uh huh... are those the same executives that think "Bananas in Pajamas" is an appropriate title for a kids' show? :hehe:

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (7/12/2008)


    Oh, I love those words! "Stuffed up"... I've got an Irish friend at work who says they "buggered it up"... if people only know how nasty those words really were. 😛

    I do actually. English background showing through.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Bananas in pyjamas are coming down the stairs,

    Bananas in pyjamas are coming down in pairs,

    Bananas in pyjamas are chasing teddy bears,

    'Cause on Tuesdays they all try to catch them unawares!

    🙂

    karthik

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply