I'm doing some initial review of data in SQL. Things like:
SELECT COUNT(DISTINCT mycolmnname) FROM mytable
SELECT COUNT (mycolumnname) FROM mytable
SELECT TOP 10 (mycolumnname) FROM mytable
I've got a ton of tables and columns to do this with so I thought I could use a variable in my query rather than replacing the column name every time.
Any help will be greatly appreciated.