Posted By

pauliehaha on 02/09/09


Tagged


Versions (?)

Find Table Column


 / Published in: SQL
 

  1. -- Find a table column on SQL Server
  2. SELECT [name]
  3. FROM sysobjects
  4. WHERE [id] IN
  5. (
  6. SELECT [id]
  7. FROM syscolumns
  8. WHERE [name] = 'THE_COLUMN_NAME'
  9. )
  10.  
  11. ' Or '
  12.  
  13. SELECT [name]
  14. FROM sysobjects
  15. WHERE [id] IN
  16. (
  17. SELECT [id]
  18. FROM syscolumns
  19. WHERE [name] LIKE '%PART_OF_NAME%'
  20. )

Report this snippet  

You need to login to post a comment.