Finding a table in a large database where you only know the column names

While working with a large database, I had an entity whose name did not match any of the tables. All I knew were the column names as they are the properties in the data structure in the code.

Fortunately this little bit of SQL shows you all the tables that have a column with the name specified:

use NameOfDatabase
SELECT c.name AS ColName, t.name AS TableName
FROM sys.columns c
    JOIN sys.tables t ON c.object_id = t.object_id
WHERE c.name LIKE '%NameOfColumn%'
Advertisements

Show text hidden after running an Activator command in Cygwin

This is a weird one which does not have a fix as far as I know.
If you run an Activator command or a command that calls Activator at some point via Cygwin, once it is finished or cancelled, whatever you type in cygwin will not display.
To see what you’re typing, you have to type “stty sane” and hit enter.