SQL Server Search Stored Procedure and View Text
Apr 9, 2026 / · 10 min read · sql server sql scripts sys.sql_modules sys.objects stored procedures views database administration object search maintenance scripts schema management ·Before a column is renamed or a table is dropped, the question is which procedures, views, and functions still mention it. This script answers that by searching the stored text of every SQL module in the current database for a keyword, matching on the object name as well as the definition. It returns the schema, object …
Read MoreSQL Server Error Log Search Script: xp_readerrorlog
Apr 8, 2026 / · 9 min read · sql server sql scripts xp_readerrorlog sp_readerrorlog error log database administration monitoring diagnostics maintenance scripts sys.sp_enumerrorlogs ·A database goes suspect at 2 a.m., a backup job reports failure, or one login is being refused again and again, and the answer is a line in the SQL Server error log. This script finds that line from T-SQL: it filters by keyword, narrows by time window, reads archived logs and loads the result into a temp table for …
Read MoreSQL Server DBCC CHECKIDENT: Bulk Identity Column Analysis
Aug 3, 2025 / · 8 min read · sql server database administration identity columns maintenance scripts dbcc commands sql scripts dbcc checkident sysobjects sys.tables sys.schemas sys.identity_columns ·DBCC CHECKIDENT with NORESEED reports the current identity value of a table next to the largest value actually stored in the identity column, without changing either. It works on one table per call, so checking a whole database means writing one command per table. The script below generates those commands from the …
Read MoreSQL Server Scripts and Database Commands 6.5, 7.0, 8.0, 9.0, 10.0, 10.50, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0 The corresponding version numbers: SQL Server 6.5, SQL Server 7.0, SQL Server 2000 (8.0), SQL Server 2005 (9.0), SQL Server 2008 (10.0), SQL Server 2008 R2 (10.50), SQL Server 2012 (11.0), SQL Server 2014 …
Read More