I need a query to generate column names (and it's type if possible) of all tables in database.
Is there any simple way?
You can use INFORMATION_SCHEMA.COLUMNS
:
select c.*
from INFORMATION_SCHEMA.COLUMNS c;
This has name, type, and a lot of other information for all tables in a database -- note, not on a server but in a database.