<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>SpDev blog</title><description>Practical articles on SQL Server stored procedures, execution plans and performance.</description><link>https://spdev.app/</link><language>en-us</language><item><title>AddWithValue, Dapper and EF Core: the NVARCHAR parameter that slows your queries</title><link>https://spdev.app/blog/addwithvalue-varchar-nvarchar/</link><guid isPermaLink="true">https://spdev.app/blog/addwithvalue-varchar-nvarchar/</guid><description>What parameter types ADO.NET, Dapper and EF Core really send for .NET strings, why NVARCHAR against a VARCHAR column scans the index, and how to fix it in each library. Verified with SQL Server&apos;s plan cache.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>.NET</category></item><item><title>Calling SQL Server stored procedures from C#: ADO.NET, Dapper and EF Core</title><link>https://spdev.app/blog/call-stored-procedure-from-csharp/</link><guid isPermaLink="true">https://spdev.app/blog/call-stored-procedure-from-csharp/</guid><description>Working C# code to call a stored procedure, read several result sets, and get output parameters and return values with ADO.NET, Dapper and EF Core, plus the mistakes that return null.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>.NET</category></item><item><title>COALESCE vs ISNULL in SQL Server: the differences that matter</title><link>https://spdev.app/blog/coalesce-vs-isnull/</link><guid isPermaLink="true">https://spdev.app/blog/coalesce-vs-isnull/</guid><description>ISNULL and COALESCE both replace NULLs, but differ in return type, truncation, nullability and how often they evaluate a subquery. Each difference shown with a query you can run.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>T-SQL</category></item><item><title>How to write a stored procedure in SQL Server: a template that holds up</title><link>https://spdev.app/blog/create-stored-procedure-sql-server/</link><guid isPermaLink="true">https://spdev.app/blog/create-stored-procedure-sql-server/</guid><description>A stored procedure template for SQL Server with SET options, parameter checks, a transaction and error handling that works, and the reasons behind each line.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Stored procedures</category></item><item><title>CROSS APPLY and OUTER APPLY in SQL Server, with practical examples</title><link>https://spdev.app/blog/cross-apply-sql-server/</link><guid isPermaLink="true">https://spdev.app/blog/cross-apply-sql-server/</guid><description>What APPLY does that a JOIN can&apos;t: top N rows per group, calling table-valued functions per row, unpivoting columns and reusing calculations. With reads compared against ROW_NUMBER.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>T-SQL</category></item><item><title>CTEs in SQL Server: WITH, recursive queries and the performance myth</title><link>https://spdev.app/blog/cte-sql-server/</link><guid isPermaLink="true">https://spdev.app/blog/cte-sql-server/</guid><description>What a common table expression is, how to write recursive CTEs for hierarchies and date series, MAXRECURSION, and why a CTE used twice is computed twice.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>T-SQL</category></item><item><title>Cursors in SQL Server: when they&apos;re fine, and how to replace them</title><link>https://spdev.app/blog/cursors-sql-server/</link><guid isPermaLink="true">https://spdev.app/blog/cursors-sql-server/</guid><description>How T-SQL cursors and WHILE loops work, why row-by-row code is slow, the cursor options that matter, and set-based rewrites for the common cases, with timings.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>T-SQL</category></item><item><title>How to debug a stored procedure in SQL Server</title><link>https://spdev.app/blog/debug-stored-procedure-sql-server/</link><guid isPermaLink="true">https://spdev.app/blog/debug-stored-procedure-sql-server/</guid><description>SSMS no longer has a T-SQL debugger. Here are the ways to debug a SQL Server stored procedure today: Visual Studio, RAISERROR WITH NOWAIT, logging that survives a rollback, and stepping through it in VS Code.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Stored procedures</category></item><item><title>How to execute a stored procedure in SQL Server: every way, with examples</title><link>https://spdev.app/blog/execute-stored-procedure-sql-server/</link><guid isPermaLink="true">https://spdev.app/blog/execute-stored-procedure-sql-server/</guid><description>EXEC with named and positional parameters, defaults, OUTPUT parameters, return codes, INSERT...EXEC, WITH RESULT SETS, calling one procedure from another, and the errors you&apos;ll meet.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Stored procedures</category></item><item><title>How to find text in stored procedures in SQL Server</title><link>https://spdev.app/blog/find-text-in-stored-procedure/</link><guid isPermaLink="true">https://spdev.app/blog/find-text-in-stored-procedure/</guid><description>Search the code of every stored procedure, function, view and trigger for a table, column or phrase. Why INFORMATION_SCHEMA misses matches, how to search all databases, and how to find real dependencies.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Stored procedures</category></item><item><title>Implicit conversion in SQL Server: why your index isn&apos;t used</title><link>https://spdev.app/blog/implicit-conversion-sql-server/</link><guid isPermaLink="true">https://spdev.app/blog/implicit-conversion-sql-server/</guid><description>An NVARCHAR parameter against a VARCHAR column can turn a 6-read seek into a 600-read scan. How to spot implicit conversions in the plan, and how to fix them in T-SQL and .NET.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Performance</category></item><item><title>The MERGE statement in SQL Server: syntax, pitfalls and safer alternatives</title><link>https://spdev.app/blog/merge-statement-sql-server/</link><guid isPermaLink="true">https://spdev.app/blog/merge-statement-sql-server/</guid><description>How to write an upsert with MERGE in SQL Server, the errors you&apos;ll meet, why it needs HOLDLOCK under concurrency, and when separate UPDATE and INSERT statements are the better choice.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>T-SQL</category></item><item><title>WITH (NOLOCK) in SQL Server: what it really does, and what to use instead</title><link>https://spdev.app/blog/nolock-sql-server/</link><guid isPermaLink="true">https://spdev.app/blog/nolock-sql-server/</guid><description>NOLOCK doesn&apos;t just skip waiting: it reads uncommitted data and can miss or double-count rows. A two-session demonstration, the errors it causes, and why READ_COMMITTED_SNAPSHOT is usually the better fix.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Performance</category></item><item><title>Parameter sniffing in SQL Server: what it is and how to fix it</title><link>https://spdev.app/blog/parameter-sniffing-sql-server/</link><guid isPermaLink="true">https://spdev.app/blog/parameter-sniffing-sql-server/</guid><description>Why a stored procedure is fast for one customer and slow for another, how to prove it&apos;s parameter sniffing, and the fixes that work, from a covering index to OPTION (RECOMPILE).</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Performance</category></item><item><title>PIVOT and UNPIVOT in SQL Server, including dynamic PIVOT</title><link>https://spdev.app/blog/pivot-sql-server/</link><guid isPermaLink="true">https://spdev.app/blog/pivot-sql-server/</guid><description>Turn rows into columns with PIVOT, the conditional aggregation alternative that&apos;s often clearer, a dynamic PIVOT for unknown columns, and UNPIVOT back again.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>T-SQL</category></item><item><title>SQL query optimization in SQL Server: a practical checklist</title><link>https://spdev.app/blog/sql-query-optimization/</link><guid isPermaLink="true">https://spdev.app/blog/sql-query-optimization/</guid><description>Ten checks that fix most slow SQL Server queries, from sargable predicates to catch-all searches, each with logical reads measured before and after.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Performance</category></item><item><title>How to read a SQL Server execution plan</title><link>https://spdev.app/blog/sql-server-execution-plans/</link><guid isPermaLink="true">https://spdev.app/blog/sql-server-execution-plans/</guid><description>Estimated vs actual plans, how to get them in SSMS, VS Code and T-SQL, how to read the operators, and the eight things to look for when a query is slow.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Performance</category></item><item><title>SQL Server development in VS Code after Azure Data Studio</title><link>https://spdev.app/blog/sql-server-in-vs-code/</link><guid isPermaLink="true">https://spdev.app/blog/sql-server-in-vs-code/</guid><description>Azure Data Studio was retired on 28 February 2026. How to set up VS Code for SQL Server work: the MSSQL extension, a local SQL Server in Docker, procedures in source control, debugging and profiling.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Tools</category></item><item><title>SQL Server indexes explained: clustered, nonclustered and covering</title><link>https://spdev.app/blog/sql-server-indexes/</link><guid isPermaLink="true">https://spdev.app/blog/sql-server-indexes/</guid><description>How SQL Server indexes work, when the optimizer uses them and when it ignores them, key lookups, covering indexes and column order, with logical reads measured on real data.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Performance</category></item><item><title>Monitoring SQL Server performance with built-in tools</title><link>https://spdev.app/blog/sql-server-performance-monitoring/</link><guid isPermaLink="true">https://spdev.app/blog/sql-server-performance-monitoring/</guid><description>Monitor SQL Server performance without buying anything: what&apos;s running now, who is blocking whom, performance counters, Query Store regressions and Extended Events, with queries you can run today.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Performance</category></item><item><title>SQL Server performance tuning: find the slow query before you fix it</title><link>https://spdev.app/blog/sql-server-performance-tuning/</link><guid isPermaLink="true">https://spdev.app/blog/sql-server-performance-tuning/</guid><description>A method for SQL Server performance tuning: start from waits, find the queries that cost the most with Query Store and DMVs, fix them one at a time, and prove each fix.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Performance</category></item><item><title>SQL Server Profiler: what it does, why it&apos;s deprecated, and what to use instead</title><link>https://spdev.app/blog/sql-server-profiler/</link><guid isPermaLink="true">https://spdev.app/blog/sql-server-profiler/</guid><description>SQL Server Profiler is deprecated. How to capture the same trace with Extended Events in T-SQL, read the results with a query, and profile a single stored procedure line by line.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Tools</category></item><item><title>Transactions in SQL Server: BEGIN, COMMIT, ROLLBACK and XACT_ABORT</title><link>https://spdev.app/blog/sql-server-transactions/</link><guid isPermaLink="true">https://spdev.app/blog/sql-server-transactions/</guid><description>How SQL Server transactions really behave: why a failed statement doesn&apos;t roll back by itself, what XACT_ABORT changes, how nested transactions work, and the error 266 you get from procedures.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>T-SQL</category></item><item><title>SQL Server window functions: ROW_NUMBER, RANK, LAG, running totals and the RANGE trap</title><link>https://spdev.app/blog/sql-window-functions/</link><guid isPermaLink="true">https://spdev.app/blog/sql-window-functions/</guid><description>Window functions in SQL Server with practical examples: numbering, ranking, top N per group, previous and next rows, running totals, and why the default frame gives different answers and runs slower.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>T-SQL</category></item><item><title>Stored procedure output parameters, return values and result sets</title><link>https://spdev.app/blog/stored-procedure-output-parameters-return-values/</link><guid isPermaLink="true">https://spdev.app/blog/stored-procedure-output-parameters-return-values/</guid><description>Three ways a SQL Server stored procedure returns data: result sets, OUTPUT parameters and the return code. How each works, their traps, and which to use when.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Stored procedures</category></item><item><title>Stored procedure vs function in SQL Server: differences and when to use each</title><link>https://spdev.app/blog/stored-procedure-vs-function/</link><guid isPermaLink="true">https://spdev.app/blog/stored-procedure-vs-function/</guid><description>What procedures can do that functions can&apos;t, and the other way round. Scalar, inline and multi-statement functions compared, with the performance traps of each, measured.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Stored procedures</category></item><item><title>Stored procedure vs view in SQL Server: which one to use</title><link>https://spdev.app/blog/stored-procedure-vs-view/</link><guid isPermaLink="true">https://spdev.app/blog/stored-procedure-vs-view/</guid><description>Views are saved queries you can select from; stored procedures are programs you execute. How they differ in parameters, performance, security and updates, with examples.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Stored procedures</category></item><item><title>Temp table vs table variable in SQL Server: which one, and why</title><link>https://spdev.app/blog/temp-table-vs-table-variable/</link><guid isPermaLink="true">https://spdev.app/blog/temp-table-vs-table-variable/</guid><description>Statistics, row estimates, rollback behavior, indexes, recompiles and scope: how #temp tables and @table variables differ in SQL Server 2019 and later, measured on real data.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>T-SQL</category></item><item><title>Error handling in SQL Server: TRY...CATCH, THROW and XACT_STATE</title><link>https://spdev.app/blog/try-catch-error-handling-sql-server/</link><guid isPermaLink="true">https://spdev.app/blog/try-catch-error-handling-sql-server/</guid><description>How TRY...CATCH works in T-SQL, the errors it can&apos;t catch, THROW vs RAISERROR, doomed transactions and XACT_STATE, and a CATCH block you can copy.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>T-SQL</category></item><item><title>What is a stored procedure in SQL Server? A practical introduction</title><link>https://spdev.app/blog/what-is-a-stored-procedure/</link><guid isPermaLink="true">https://spdev.app/blog/what-is-a-stored-procedure/</guid><description>What a stored procedure is, how to create and run one, what it&apos;s good for and where it hurts, with examples you can run on SQL Server.</description><pubDate>Tue, 10 Nov 2026 00:00:00 GMT</pubDate><category>Stored procedures</category></item></channel></rss>