Created
February 18, 2020 11:50
-
-
Save agrogeek/60b25fea82ae65295c33c029e5535062 to your computer and use it in GitHub Desktop.
Consulta SQL para encontrar la columna [field_name] en todas las tablas de una BD en MS SQL Server.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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('%field_name%')) | |
ORDER BY sysobjects.name, syscolumns.colid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment