Gouache painting of a small overflowing toy box beside a much larger open red toy box

ALTER Column From INT to BIGINT: Errors and Safe Solutions

To change a column from INT to BIGINT, you first drop every key and index that depends on it, because ALTER COLUMN refuses with Msg 5074 and Msg 4922. This post builds a small ticket system, shows the errors, and changes the key and its foreign key inside one transaction. It also shows how a negative identity reseed buys time, and when to copy the table instead.

Read More
Gouache painting of a leaf-clogged gutter on a stone cottage with a red bucket on the ground catching cleared leaves

MSDB Growth From queue_messages: How to Clear the Queue

MSDB growth from the queue_messages tables means a Service Broker queue holds messages that nobody reads. This post builds a queue with unread messages in a test database, finds it with a size query, ends only its conversations with the CLEANUP option, and watches the space come back. It also says why you should never end every conversation in msdb.

Read More
Gouache painting of a small rowing boat carrying a red crate across a river with no bridge

Log Shipping Alternative for Databases in Simple Recovery Model

A log shipping alternative for a database in the simple recovery model is a second copy that restores the newest full backup and the newest differential backup. This post finds those two files from the backup history in msdb, restores them with MOVE and RECOVERY, and repeats the cycle on a schedule. It also states what you lose compared with real log shipping.

Read More