SUBSTRING length question

  • I can't access a SQL Server workplace now, so I can't check the following myself.

    What happens when you use SUBSELECT with a length value, which exceeds the legth of the used string?

    Example:

    SELECT SUBSTRING ('0123456789', 4, 10)

    Would I just get '3456789' or would I get nothing? An error?

    Greetz,
    Hans Brouwer

  • You get '3456789'

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • Dr. Andras is correct, the length doesn't matter if it exceeds the total length. I've used 1000 sometimes when I'm not sure if I have 10 or 20 more spaecs and I want everything to the end.

  • OK,tnx for answering

    Greetz,
    Hans Brouwer

Viewing 4 posts - 1 through 4 (of 4 total)

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