Scripts

Technical Article

SQL Server Automated Backup & SAN Replication Solution

Script created by Syed Fahar Abbas. A Comprehensive Batch Script to: Verify/Request Administrator privileges and create a stable script copy. Grant NT AUTHORITY\SYSTEM database privileges and perform full SQL Server backup. Detect, or automatically download and silently install, WinRAR for compression. Compress the raw backup (.bak) into a high-compression RAR archive (.rar) and cleanup. Authenticate […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(1)

You rated this post out of 5. Change rating

2026-09-29

114 reads

Technical Article

Server-Level Table sizes

This script creates a stored procedure that returns the following table size metrics in kilobytes, megabytes, and gigabytes for all tables in user-created databases (database ID > 4): Reserved space Used space Unused space Index size Data size

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2026-09-14

56 reads

Technical Article

Stored Procedures for Server-Level Object and Column Search

This script creates two stored procedures: One searches for the names of all user-created objects at the server level across all user-created databases (database ID > 4) based on a specified search expression. The other searches for column names in all user-created tables and views across all user-created databases (database ID > 4) based on […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2026-09-09

50 reads

Technical Article

Server-Level Row Counts for Tables and Views

This script creates a table that will store the row counts of non-system tables and views across all user-created databases (database ID > 4) on the server, as well as a stored procedure that refreshes the row counts by recalculating them. The script uses the database ServerInfo to store the table and stored procedure. Replace […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2026-09-04

70 reads

Technical Article

Demo Tracking Dropped Objects

This script demonstrates step by step how to implement a dropped objects tracking flow. Important limitation to consider: The stored state of a dropped object is based on the most recent available snapshot and not necessarily on the state of the object immediately before it was dropped. The accuracy of the stored information depends on […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2026-08-31

50 reads

Technical Article

Randomly Selecting Columns and Rows from a Table or View

The following script creates a procedure that returns a specified number of random columns and rows from a specified table or view. The number of columns and rows is determined by the @NumberOfColumns and @Rows parameters. The @RandomColumnOrder parameter specifies whether the selected columns are returned in random order or sorted by their ordinal position […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2026-08-31

65 reads

Technical Article

Column Data Types

This scripts creates a view containing data type information for columns in user-defined tables and views. It provides an overview of the data types in use and can help identify opportunities for data type optimization and standardization. The data types are formatted as they appear in Object Explorer in SSMS. For example, sysname is displayed […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2026-08-25

67 reads

Blogs

The Book of Redgate:A Prehistory

By

I’ve covered the values in a number of previous posts on the Book of...

Evidence-bound: what AgentDBA will and won’t link

By

When the evidence names the database, it says so. When it doesn’t, it stops....

Prep data for AI vs. Fabric Data Agent Instructions: What Goes Where?

By

Making Data AI-Ready, Part 3 (This is the final article in a three-part series...

Read the latest Blogs

Forums

Alamat BCA KCP Atrium Telp:08218520154

By layanan_Bca88

WhatsApp CS 628218520154 Ruko Atrium Blok E. 12-13, RT.5/RW.18, Sunter Agung, Kec. Tj. Priok,...

Alamat BCA KCP Bungur Telp:08218520154

By R4nt4u

WhatsApp CS 628218520154 Jl. Bungur Besar Raya No.32 & 32A, RT.3/RW.1, Gn. Sahari Sel.,...

Alamat BCA KCP Cempaka Putih Raya Telp:08218520154

By m4rt1n4

WhatsApp CS 628218520154 Jl. Cempaka Putih Raya No.118 B,C,D, RT.16/RW.3, Cemp. Putih Tim., Kec....

Visit the forum

Question of the Day

Hyperscale Replicas III

In an Azure SQL Database Hyperscale Edition, how many named replicas can be configured?

See possible answers