Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hi there, can anyone help me make a stored procedure that accepts a table name as its parameter and returns field names and their respective minimum values? I searched around and found a query to get all the field names:
I do this frequently enough to want to write a stored procedure for it, but I'm usually checking for more than just the minimum values - I also like to check how many nulls there are, how many unique values, and some basic stats (min, max, average, etc.). Couldn't the data types all be cast as strings? The purpose of this would be to just get a quick summary of the data to see if there's anything worth investigating.