Search DB for column names

Here is a handy bit of SQL used to search a database for tables that contain a specific column name:

		Select
	name 
	from sysobjects 
	where id in (select id from syscolumns 
	where name like '%ColumnName%')
	
Pretty handy if you have a database with a lot of tables in and you need to find the correct tables etc.
Posted: Oct 13 2008, 09:06 by Adrian | Comments (436) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: SQL

Comments

Add comment


 

  Country flag

biuquote
  • Comment
  • Preview
Loading