MS SQL Server – Loop through database tables and columns

Test Environment: MS Server 2008

Stored procedure to loop through all tables and all columns in a database

Change [DATABASE_NAME],[SCHEMA_NAME],[USER_NAME] accordingly

Execute Stored Procedure: