Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Query a DB for a field value on SQL 2005 STD SP2

Query a DB for a field value on SQL 2005 STD SP2

Scheduled Pinned Locked Moved Database
databasequestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hulicat
    wrote on last edited by
    #1

    This does not seem to work; I dont know which table the value is in. USE DB Go SELECT * FROM sys.Tables where fieldid = '%' GO I presume I cannot use a conditional clause in that statement? It will parse but errors out

    Regards, Hulicat

    D 1 Reply Last reply
    0
    • H Hulicat

      This does not seem to work; I dont know which table the value is in. USE DB Go SELECT * FROM sys.Tables where fieldid = '%' GO I presume I cannot use a conditional clause in that statement? It will parse but errors out

      Regards, Hulicat

      D Offline
      D Offline
      David Mujica
      wrote on last edited by
      #2

      This is what I would use ...

      select SO.NAME AS TABLENAME, SC.NAME AS COLNAME
      from sysobjects so, syscolumns sc
      where so.id = sc.id and sc.name = 'DESCRIPTION'

      This query will give you a listing of every table that has a field that is named, 'DESCRIPTION'. Good luck, david

      H 1 Reply Last reply
      0
      • D David Mujica

        This is what I would use ...

        select SO.NAME AS TABLENAME, SC.NAME AS COLNAME
        from sysobjects so, syscolumns sc
        where so.id = sc.id and sc.name = 'DESCRIPTION'

        This query will give you a listing of every table that has a field that is named, 'DESCRIPTION'. Good luck, david

        H Offline
        H Offline
        Hulicat
        wrote on last edited by
        #3

        Thanks!

        Regards, Hulicat

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups