Tabellen und Spalten in Datenbank filtern

SELECT T1.object_id, T1.name AS Spaltenname, T2.name AS Tabelle , T3.name AS SchemaName FROM sys.columns T1

LEFT JOIN sys.tables AS T2

ON T1.object_id = t2.object_id

LEFT JOIN sys.schemas AS T3 ON T2.schema_id = T3.schema_id

where T1.name like '%Grund%' 

 

AND T3.name = 'PROVIA' 

 

1 Antwort
  1. AZConAdmin sagte:

    SELECT T1.object_id, T1.name AS Spaltenname, T2.name AS Tabelle,T2.schema_id,T3.name ,
    SUM([Partitions].[rows]) AS T
    FROM sys.columns T1
    LEFT JOIN sys.tables AS T2
    ON T1.object_id = t2.object_id
    LEFT JOIN sys.schemas AS T3 ON T2.schema_id = T3.schema_id
    LEFT JOIN sys.partitions AS [Partitions]
    ON T2.[object_id] = [Partitions].[object_id]
    AND [Partitions].index_id IN ( 0, 1 )
    where T1.name like 'LEISTUNGARTID'
    and T2.name not like 'TMP%'
    GROUP BY
    T1.object_id,
    T1.name ,
    T2.name,T2.schema_id,T3.name
    HAVING SUM([Partitions].[rows])>0

Dein Kommentar

An Diskussion beteiligen?
Hinterlasse uns Deinen Kommentar!

Schreibe einen Kommentar