Articles tagged #SQL Server
16 article(s)
-
Modern .NET Backend Roadmap — Part 3: Dapper for Fast Reads
Add a Dapper read path beside EF Core: read models behind a port, parameterized SQL, mapping gotchas we actually hit, and when each tool wins.
@llaxmikant · Jun 5, 2026 -
Getting Started with ASP.NET Core Web API and Entity Framework
Build your first ASP.NET Core Web API on .NET 10 with Entity Framework Core — scaffold models from SQL Server, add an async controller, and test with the built-in OpenAPI document and Scalar.
@llaxmikant · May 28, 2026 -
How to Pivot Data in SQL Server
Rotate rows into columns with PIVOT, the CASE alternative for multiple aggregates, dynamic pivots with STRING_AGG and sp_executesql, and UNPIVOT (plus CROSS APPLY VALUES) for the reverse.
@llaxmikant · Mar 6, 2026 -
Bulk Upload into SQL Server using SqlBulkCopy and C#
Load 100,000 rows in under a second with SqlBulkCopy: column mappings, batch sizes, transactions, staging tables, and the constraint fine print — measured for real.
@llaxmikant · Feb 28, 2026 -
OUTER APPLY and CROSS APPLY in SQL Server with Examples
Per-row table expressions: top-N-per-group queries, passing row values into table-valued functions, APPLY (VALUES) for named expressions, and when plain JOIN is all you need.
@llaxmikant · Feb 7, 2026 -
Read appsettings.json in a .NET Class Library with Dependency Injection
The options pattern done right: the host owns configuration sources, the library declares typed settings, and DI carries one to the other — with validation at startup.
@llaxmikant · Jan 28, 2026 -
SQL Server Common Table Expressions with Examples
CTEs from basics to recursion — readable query pipelines, the top-N-per-group idiom with window functions, chained CTEs, writable CTEs for dedup, and walking hierarchies of any depth.
@llaxmikant · Jan 3, 2026 -
SQL Server Stored Procedure vs User-Defined Function
Functions compute inside queries; procedures do work. The full capability matrix, parameter sniffing notes, and a mechanical decision guide with working examples of each.
@llaxmikant · Dec 15, 2025 -
User-Defined Functions in SQL Server
Scalar, inline table-valued, and multi-statement functions with real outputs — why inline TVFs optimize like views, when scalar UDFs go per-row, and why MSTVFs are a last resort.
@llaxmikant · Nov 26, 2025 -
Convert a DataTable to CSV, List or JSON in .NET
Three DataTable conversions done right in .NET 10: RFC-4180 CSV with quoting, typed List<T> via DataRow.Field, and JSON through records — edge cases verified.
@llaxmikant · Nov 19, 2025 -
SQL Server Temporary Table vs Table Variable
Statistics, indexing, scope, and rollback behavior compared with runnable examples — why table variables wreck big-join plans and where they genuinely win.
@llaxmikant · Oct 23, 2025 -
Exception Handling using TRY/CATCH in SQL Server
TRY/CATCH with the ERROR_* functions, the transaction-safety template with XACT_ABORT, re-raising with THROW, error logging that survives rollback, and what CATCH can't catch.
@llaxmikant · Sep 22, 2025 -
Access SQL Server from a .NET Console Application
Connect to SQL Server from a .NET 10 console app with Microsoft.Data.SqlClient: connections, parameterized commands, data readers, transactions, and where Dapper and EF Core fit.
@llaxmikant · Sep 21, 2025 -
Generate Sequence Numbers in SQL Server Queries
ROW_NUMBER, RANK, DENSE_RANK, and NTILE side by side, PARTITION BY for per-group numbering, and persistent numbering with IDENTITY and SEQUENCE — all with verified outputs.
@llaxmikant · Aug 20, 2025 -
SQL Server Constraints with Examples
All six constraint types on one table — PRIMARY KEY, UNIQUE, CHECK, DEFAULT, FOREIGN KEY, NOT NULL — each violated on purpose so you see the real errors, plus naming and FK-index guidance.
@llaxmikant · Jul 22, 2025 -
Types of SQL Server Joins with Examples
INNER, LEFT, RIGHT, FULL OUTER, CROSS, and self joins explained on one dataset with real results — including the anti-join pattern and the WHERE-vs-ON trap that breaks LEFT JOINs.
@llaxmikant · Jun 20, 2025