Return to Snippet

Revision: 16325
at July 31, 2009 03:53 by marcocs


Initial Code
USE MYDB
GO

DECLARE @Value NVARCHAR(128);
SELECT  @Value = 'ID'; -- Nombre a buscar

SELECT  OBJECT_NAME(object_id) AS object_name,
        c.name AS column_name,
        TYPE_NAME(c.user_type_id) AS user_type_name,
        c.max_length
FROM    sys.columns AS c
        INNER JOIN sys.types AS t ON c.user_type_id = t.user_type_id
WHERE   c.name like '%'+@Value+'%' and OBJECT_NAME(object_id) not like 'syn%'

Initial URL

                                

Initial Description
Buscar tablas por nombre de columnas;

Initial Title
Buscar tablas por nombre de columnas

Initial Tags

                                

Initial Language
SQL