Example: Working on a project and needed to get list of all the tables from all the databases with columns and columns demographic. This information can be needed for many reasons. The below script uses cursor to loop through all the databases to get the list of tables with columns. I have ignored the system databases such as master, model, msdb and tempdb. You can filter the databases on which you would like to run the query. ________________________________________________________ USE Master GO --Declare Variables DECLARE @DatabaseName AS VARCHAR(500) --Create Temp Table to Save your Results IF OBJECT_ID('tempdb..#Results') IS NOT NULL DROP TABLE #Results CREATE TABLE #Results ( ServerName VARCHAR(150) ,DatabaseName VARCHAR(150) ,SchemaName VARCHAR(150) ,TableName VARCHAR(150) ,ColumnName VARCHAR(150) ,Data_Type VARCHAR(150) ,Is_Nullable VARCHAR(25) ,Character_Maximum_Length VARCHAR(10) ) DECLARE CUR CURSOR