how to achive when all the row comment need to updated in single column in sqlserver 2000

  • Hi ,

    The Following query needs to be execute in sql server 2000 environment.

    I have two tables like tab and tabcomments

    tab table structure look like this....

    create table dbo.tab(appid int,comment varchar(5000))

    create table dbo.tabcomment(commentid int identity(1,1),appid int,comment varchar(5000)

    insert into dbo.tab values(1000,' ')

    insert into dbo.tab values(1001,' ')

    ---------------------------

    select * from dbo.tab

    --------------------

    appid comment

    1000

    1001

    insert into dbo.tabcomment values(1000,'read')

    insert into dbo.tabcomment values(1000,'book')

    insert into dbo.tabcomment values(1000,'notepad')

    insert into dbo.tabcomment values(1001,'scriblingpad')

    insert into dbo.tabcomment values(1001,'advancedPC')

    -------------------------------

    select * from dbo.tabcomment

    -----------------------------

    Commentid,appid, comment

    1 1000 read

    2 1000 book

    3 1000 notepad

    4 1001 scriblingpad

    5 1001 advancedPC

    ----------------------------------------------------

    we are expecting the result like this

    select * from dbo.tab

    ---------------------------

    appid Comment

    1000 read,book,notepad

    1001 scriblingpad,advancedPC

    ----------

    could you please let me know, how can i achive this result. If you have any script, kinldy share with me..

    Thanks & Regards

    Balaji G

  • Unfortunately, SQL 2000 doesn't offer that many options.

    One solution I can think of is to use a function.

    An example can be found at Adam Machanics blog



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

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

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