Update column

  • Hello All,

    I have a table which contains column named forum_name, forum_id, parent_id & forum_type. This is mainly designed for content management.

    Forum_name contains both category and sub category names, For each forum_name inserted forum_id will be generated(identity). Forum_type decide if this row is a category or a sub category type and if yes then the value will be 1 else it will be 0.

    I want to update the parent_id with forum_id of the category name. Pleae help me in writing this TSQL.

    Data example:

    Catagory Sub Category

    =========== ===============

    Advertising General

    Agency ManagementCreative Agency Management

    Agency ManagementGeneral

    Agency ManagementInteractive Agency Management

    Agency ManagementMedia Agency Management

    Best Practices Brand Planning

    Best Practices General

    Best Practices HoReCa

    Cheers,

    Got an idea..share it !!

    DBA_Vishal

  • I'm not really sure what you're trying to accomplish. Can you provide table scripts and inserts as well as what you've already tried? Here's a link on best practices in posting here

    www.sqlservercentral.com/articles/Best+Practices/61537/

    For better, quicker answers, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

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

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