Create a stored procedure in SQL Server that returns total count of columns in table and distinct count of values in each column
问题 I need a stored procedure that takes any table name as a parameter and returns total count of rows and distinct count of values in each column of that particular table when executed. Let's take the sample table as below: create table journey ( Src varchar(255), Dest varchar(255) ) insert into journey values ('Jaipur', 'Mumbai'), ('Mumbai', 'Jaipur'), ('Kolkata', 'Bangalore'), ('Bangalore', 'Indore'),('Indore', 'Lucknow'), ('Lucknow', 'Indore') Can anybody help me with this task of dynamic SQL