SQL Server Query Utilities

Search tables

SELECT c.name AS ‘ColumnName’,
(SCHEMA_NAME(t.schema_id) + ‘.’ + t.name) AS ‘TableName’
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
WHERE c.name LIKE ‘%ColumnNam…


This content originally appeared on DEV Community and was authored by Romero Dias

Search tables

SELECT      c.name  AS 'ColumnName',
            (SCHEMA_NAME(t.schema_id) + '.' + t.name) AS 'TableName'
FROM        sys.columns c
JOIN        sys.tables  t   ON c.object_id = t.object_id
WHERE       c.name LIKE '%ColumnName%'
ORDER BY    TableName
            ,ColumnName;


This content originally appeared on DEV Community and was authored by Romero Dias


Print Share Comment Cite Upload Translate Updates
APA

Romero Dias | Sciencx (2024-06-26T01:05:02+00:00) SQL Server Query Utilities. Retrieved from https://www.scien.cx/2024/06/26/sql-server-query-utilities-2/

MLA
" » SQL Server Query Utilities." Romero Dias | Sciencx - Wednesday June 26, 2024, https://www.scien.cx/2024/06/26/sql-server-query-utilities-2/
HARVARD
Romero Dias | Sciencx Wednesday June 26, 2024 » SQL Server Query Utilities., viewed ,<https://www.scien.cx/2024/06/26/sql-server-query-utilities-2/>
VANCOUVER
Romero Dias | Sciencx - » SQL Server Query Utilities. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/06/26/sql-server-query-utilities-2/
CHICAGO
" » SQL Server Query Utilities." Romero Dias | Sciencx - Accessed . https://www.scien.cx/2024/06/26/sql-server-query-utilities-2/
IEEE
" » SQL Server Query Utilities." Romero Dias | Sciencx [Online]. Available: https://www.scien.cx/2024/06/26/sql-server-query-utilities-2/. [Accessed: ]
rf:citation
» SQL Server Query Utilities | Romero Dias | Sciencx | https://www.scien.cx/2024/06/26/sql-server-query-utilities-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.