Tip : Protecting Yourself from SQL Injection in SQL Server – Part 1
For T-SQL Tuesday, I discuss undocumented trace flags that provide additional diagnostics to troubleshoot slow backup or restore operations.
I walk through some of the new JSON-related Transact-SQL functionality that will be available in SQL Server 2016.
Tip : Convert Existing SQL Server Traces to Extended Events Sessions
For T-SQL Tuesday< #65, I give a little detail on something I learned this week about altering a column from NOT NULL to NULL.
A little advice on the use of MDF/LDF files for backups.
I discuss the benefits of explicitly referencing columns in a query.
I follow up on a question from a triggers presentation at SQLBits, addressing the impact of trigger overhead for T-SQL Tuesday.
I show DDL commands in Azure SQL Database that can now run as online operations instead of blocking, size-of-data operations.
I address a popular theory that NOLOCK can substantially reduce locking overhead against #temp tables.
I talk about a couple of subtleties of THROW, and how to avoid frustrating bouts of troubleshooting.
I describe a scenario where Common Criteria compliance was deemed the cause of high LCK_M_SCH_M waits for multiple customers.
I show some views I use to make metadata queries simpler.
I show how to use common table expressions (CTEs) to better optimize SQL Server pagination queries that use OFFSET / FETCH.
I examine various impacts on SQL Server – not just disk space – when choosing a GUID as a clustering key.
I walk through several potential causes for different plans and/or performance for the same database on two "identical" servers.
Tip: Finding views with (or without) a certain property
I discuss a handful of reasons "identical" queries might yield multiple plans, contributing to plan cache bloat.
Tip: Over 40 queries to find tables with or without a certain property
I show some tricks for getting row counts efficiently, and explain why an accurate row count for a large table is a pipe dream.
I repeat "Bad habits" advice from the past about using statement terminators and schema references to avoid debugging troubles.
I demonstrate an affordable approach to readable secondaries, without the need for Availability Groups and all the licensing costs involved with Enterprise Edition and Software Assurance.
I point out that an often-used connection setting, AttachDBFileName, may be the source of many wasted hours of debugging and troubleshooting.
In this tip, I show how to use dynamic SQL to drop and re-create all foreign keys.
I treat a common scenario: behavior differs between two SQL Server databases that may be the same version, but different compatibility levels.
Tip : What Effect Does Persisting a Computed Column Have in SQL Server?
I discuss the NOLOCK hint in SQL Server, and why you want to avoid slapping it onto every table mentioned in every query.
Tip : What Happens When a Computed Column is Persisted in SQL Server?
I discuss examples where people expect SQL Server to perform tasks that really should be performed outside the scope of the database.
Tip : Change All Computed Columns to Persisted in SQL Server
I discuss ten common cases of misplaced optimization.
Tip : SQL Server Video – Tricks to play on your DBA – 2
I explain why you should avoid helper functions, and join against the catalog views instead.
I provide four real-world examples where grouped concatenation allows you to avoid the monotony of cursors and while loops.
I take a closer look at some additional requirements for typical grouped concatenation queries in SQL Server.
Tip : SQL Server Video – Tricks to play on your DBA – 1
I use a T-SQL Tuesday theme to demonstrate a use case for the SQL_VARIANT data type that you may not have considered: Conditional ORDER BY.
I show the safest and most efficient ways to perform grouped concatenation in SQL Server.
Following a recent update, I take a first look at a new performance enhancement and trace flag (2453) aimed at improving cardinality estimates for table variables and table-valued parameters.
I look at some unexpected behavior with the CASE expression and some of its derivatives.