This puzzle assigns a nine digit number to a varchar(8) variable and gets an asterisk instead of a number. The answer is an implicit conversion that does not fit. The post tests which data types behave this way, which ones raise an error, and how to size the variable.
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.
PostgreSQL Local Variable: DECLARE in a plpgsql Function
A PostgreSQL local variable is declared in the DECLARE section of a plpgsql function or DO block. This post tests a function with two variables, the NULL start value, scope, CONSTANT, STRICT, a name clash error and the psql alternative.
Memory-Optimized Table Variables
Memory-optimized table variables can avoid tempdb work, but they need a filegroup, indexed table type, memory budget, and workload tests.
How to Pass Stored Procedure Result to Another Procedure in SQL Server
To pass stored procedure result values from one procedure to another, use an OUTPUT parameter. This post tests RETURN codes, INSERT … EXEC and table-valued parameters on a small order demo. It also shows the errors each method raises and when a function is the better tool.
Second-Order SQL Injection: When Stored Data Becomes Code
A safe insert does not make the saved value safe forever. Here is how stored text turns into code later, and the plain fix.







