Forum Replies Created

Viewing post 1 (of 1 total)

  • Reply To: Get Distinct Value from each column in a Table

    This lists all not null columns with the record counts

    --Drop table #T

    select Row_number() over(order by column_name) Row,COLUMN_NAME

    into #T

    from INFORMATION_SCHEMA.columns

    where table_name = '<table_name>'

    Create table #Results ([Column_Name] varchar(200), Rec_Count int)

    --Truncate table #Results

    declare...

Viewing post 1 (of 1 total)