📜  buscar nombre de columna en todas las tablas sql server - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:16.189000             🧑  作者: Mango

代码示例1
SELECT  sysobjects.name AS table_name, syscolumns.name AS column_name,
           systypes.name AS datatype, syscolumns.LENGTH AS LENGTH
FROM       sysobjects INNER JOIN
               syscolumns ON sysobjects.id = syscolumns.id INNER JOIN
               systypes ON syscolumns.xtype = systypes.xtype
WHERE     (sysobjects.xtype = 'U') 
                and (UPPER(syscolumns.name) like upper('%myFieldName%'))
ORDER BY sysobjects.name, syscolumns.colid