Use sp_refreshsqlmodule to refresh changed table dependencies, inspect stale view columns, and protect stable contracts with schema binding.
SQL SERVER – Query to Find Column From All Tables of Database
How many AdventureWorks tables have an EmployeeID column? My query on sys.tables and sys.columns finds any column from all tables, with schema names.
SQL SERVER – Find Space Used For Any Particular Table
Running out of drive space is a common reason SQL Server stops. sp_spaceused shows the Space Used by any table, with its row count and index size.
Finding Dynamic SQL Open to Injection
Find dynamic SQL open to injection by searching module definitions for concatenation, then replace data concatenation with parameters.
SQL SERVER – Create a Comma Delimited List Using SELECT Clause From Table Column
I received following question in email : How to create a comma delimited list using SELECT clause from table column?
SQL SERVER – 2008 – Row Constructors – Load Temp Tables From Stored Procedures
Load temp tables from stored procedures with a simple INSERT INTO EXEC instead of a loopback OPENQUERY. Here is the before and after code.
A Self-Review Checklist for Stored Procedure Changes
Use a self-review checklist for stored procedure changes: realistic data, plans, IO, NULL inputs, clean rollback, and a ready recovery script.







