Concatenation function

  • Guys,

    I have following scenario for which I need to build a concatenating functions

    IDTYPENAME

    ____________________

    1DSMITH

    1DDOE

    1PRICH

    1P GARMIN

    2DJEN

    2DDORTHY

    I want to create a function for which I pass ID, placeholder, type; it should give me a concatenated names.

    when I execute dbo.getname(1, '|', 'D') I should get output as 1, SMITH|DOE

    dbo.getname(2, '|', 'D') I should get output as 2, JEN|DORTHY.

    Is there any way to accomplish this?

    Thanks

  • I want to create a function for which I pass ID, placeholder, type; it should give me a concatenated names.

    Why? Basically, this is a form of "Death-by-SQL"... where are you going to use such an output?

    --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)

  • Hi ...

    As I have installed SQL 2000 and sql 2005 at the same time

    you can help me?

  • Sure... with what?

    --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)

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

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