This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Detailed painting of three matching cup-and-teapot pairs, one on a table, one in a wooden tray, and one on a fixed open shelf.

Derived Table, CTE or View: Choose the Scope

November 10, 2009
Pinal Dave
SQL Tips and Tricks
CTE, SQL Scripts, SQL Server, SQL Sub Query

A derived table, CTE and view can express the same grouped result while offering different scopes. Compare complete outputs with duplicates and NULLs, then choose a statement-local expression or a saved definition for the task.

Read More
Gouache painting: a row of four pear trees in an orchard

FIRST_VALUE IGNORE NULLS: Find the First Available Value

November 2, 2009
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Server, SQL Server 2022

FIRST_VALUE IGNORE NULLS selects the first present value through the current row. Preserve source rows and distinguish first from latest.

Read More
Beach towels laid edge to edge on the sand, seen from above, one red towel overlapping its neighbor

Preventing Overlapping Date Ranges in a Table

October 31, 2009
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL DateTime, SQL Server, SQL Transactions, SQL Trigger

Detect overlapping date ranges with joins and window queries, use half-open endpoints, and enforce the rule with a multirow trigger.

Read More
Gouache painting: a thick ring of clay hangs level from a single cord, attached to a thin wire cross that spans the ring's open center

geometry STCentroid: The Geometric Center Is Not an Interior Promise

October 30, 2009
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function, SQL Scripts, SQL Server

geometry STCentroid returns a polygon’s geometric center, but that point is not a promise of interior placement. I keep the center calculation separate from an interior test. A holed region makes that distinction visible.

Read More
A half-full compost bin with a red-handled fork, compost spread on the bed

CDC Cleanup and Capture Jobs: Keeping the Log and Change Tables Small

October 29, 2009
Pinal Dave
SQL Tips and Tricks
Change Data Capture, DBA, SQL Server Agent, Transaction Log

Keep CDC cleanup and capture jobs healthy by checking log reuse, job settings, retention, polling, and a stopped-job alert.

Read More
SQL SERVER - How to Enable Index - How to Disable Index - Incorrect syntax near 'ENABLE'

SQL SERVER – How to Enable Index – How to Disable Index – Incorrect syntax near ‘ENABLE’

October 27, 2009
Pinal Dave
SQL Tips and Tricks
SQL Index, SQL Scripts

ALTER INDEX with ENABLE fails with Incorrect syntax near ‘ENABLE’. To enable index after you disable it for a bulk load, you rebuild it instead.

Read More
An electric kettle on a counter beside three different plug adapters, one of them fitted into the wall socket.

Environment Settings in SSIS Projects

October 25, 2009
Pinal Dave
SQL Tips and Tricks
ETL, SQL Server, SQL Server Configuration, SQL Server Security, SSIS

SSIS projects can deploy one package across environments by using project parameters, SSISDB variables, and tested references.

Read More
Previous 1 … 451 452 453 454 455 456 457 … 570 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com