|
|
Cry How to...List all tables that contain a given column nameTo list all the tables in an SQL Server database that contain a given column name, use the following SQL: select sysobjects.name, * from syscolumns, sysobjects where syscolumns.name='MyColumn' and sysobjects.id = syscolumns.id and (sysobjects.xtype='U' or sysobjects.xtype='S') Note:
These notes have been tested against SQL Server 7 and SQL Server 2000. |