SQL Server Performance

Finding all the column Names using a specific value in a database

Discussion in 'SQL Server 2005 General Developer Questions' started by Crazyheartbeats, Mar 3, 2010.

  1. Crazyheartbeats New Member

    Hi Folks,
    Im looking for a query which would take a specific string value and search the database and list out all tables , columns and the value , like the input value
    Ex : the string is "test" .. the result set should be
    Table ColumnName ColumnValue
    Table1 ColA test123
    Table19 ColD Simple Test
    Any help would be highly appreciated.Thanks in advance
  2. Adriaan New Member

    Find the relevant system view to list all the columns for each table, set up a cursor that builds the required query statements and then executes it - for each table, for each column with a character data type.
  3. Madhivanan Moderator

  4. FrankKalis Moderator

  5. Madhivanan Moderator

    <P mce_keep="true">[quote user="FrankKalis"] <P>[quote user="Madhivanan"]</P><P>Refer this</P><P><A href="http://beyondrelational.com/blogs/madhivanan/archive/2009/12/14/search-a-value-in-character-column-of-all-tables.aspx">http://beyondrelational.com/blogs/madhivanan/archive/2009/12/14/search-a-value-in-character-column-of-all-tables.aspx</A></P><P>[/quote]&nbsp;</P><P>Heck, how many different blogs do you maintain? <IMG alt=Wink src="http://sql-server-performance.com/Community/emoticons/emotion-5.gif"> <BR></P><P>[/quote]</P><P>[:D] This is latest version [:D]</P>

Share This Page