Gouache painting of a wooden shape-sorter box with matching shapes in front and the round one painted red

How to Pass Parameters to a Stored Procedure in SQL Server

To pass parameters to a stored procedure, write the values after EXEC without parentheses, and name each parameter so the order can’t matter. This post builds a small order procedure and calls it by position and by name, with defaults, an OUTPUT value and a table-valued parameter. It also shows the three errors people hit first and what each one means.

Read More
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