Syntax Error

Code samples and hints

Search for column name across all tables

Alle Tabellen welche eine bestimmte Spalte besitzen ausgeben ...

 

DECLARE @ColumnName       varchar(1000)

SET @ColumnName = 'PlayerId'

    select o.name as TableName,
           c.name as [ColumnName]
      from sysobjects o 
inner join syscolumns c on c.id = o.id
      where o.type = 'u' and c.name = @ColumnName       
   Order by TableName

 

Quelle

Kommentare sind geschlossen