Project Goal
A T-SQL stored procedure that acts as a developer's utility for quickly analyzing and scripting table structures. It streamlines common tasks like generating column lists for SELECT
statements, creating aggregate queries, and performing quick data profiling, saving significant development time.
Technologies Used
- Language: T-SQL (Microsoft SQL Server)
- Techniques: Dynamic SQL, Temporary Procedures, System View Interrogation
Key Features
- Horizontal & Vertical Output: Generates clean, comma-separated column lists (horizontal) and detailed, line-by-line definitions (vertical).
- Automated Aggregation: Instantly creates aggregate query skeletons (e.g.,
COUNT()
,SUM()
) for every column in a table. - Data Survey Tool: Performs basic data profiling by showing the top 10 distinct values and a total distinct count for each column.
- Table Comparison: Compares the column metadata of two tables to quickly identify differences.
- Temp Table Support: Works seamlessly with temporary tables, making it highly useful during development and debugging sessions.
Getting Started
The procedure is self-documenting. Download the script, install it, and run the following command for a full help section with usage examples:
exec sp_Columnizer;