check if you are looking something like below....if not, post table defintions ,sample data and expected results to get faster and accurate responses.
if object_id('tempdb..#test123') is not null
drop table #test123
SELECT id1 = IDENTITY( int,1,1),table_name,COLUMN_NAME, DATA_TYPE, IS_NULLABLE
into #test123 FROM INFORMATION_SCHEMA.COLUMNS
select * from #test123
-- Jus