i want to have two queries for searching text

  • Dear

    I have two different queires for searching particular text.

    I have nearly 7 to 8 table in my database. all tables are related to each other by using foreign key.

    now i want to a query which search particular text in all fields of all tables.

    what would be qury for this.

    second question is nearly same but in this all tables are not related to each other. all tables are independent.

    what would be query.

    Waiting for reply

    Best regards,

  • Who have to loop through sysobjects and syscolumns using cursors and building dynamic queries and have to decide if you want the queries to be built for each column independently or for all like

    select * from <mytable>

    where <mycolumn1> =<mysearchstring>

    and/or <mycolumn2> = <mysearchstring>

    Based on your requirements you need to write your cursors to build the dynamic sql.

     

    Prasad Bhogadi
    www.inforaise.com

  • Yep , Prasad has given you a good solution

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

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