Most handy MS SQL query – ever

Find any field name in a MS SQL db – matching your search string (e.g. ‘perator’, as in ‘Operator’ or ‘operator’):

FROM sysobjects
JOIN syscolumns ON =
JOIN systypes ON syscolumns.xtype=systypes.xtype
WHERE sysobjects.xtype=’U’ and like ‘%perator%’

ORDER BY,syscolumns.colid

Change the ‘’ to ‘’ to search on table names.


Handy when learning a new system!