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
SQL SERVER - Get Date of All Weekdays or Weekends of the Year

SQL SERVER – Get Date of All Weekdays or Weekends of the Year

December 29, 2009
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

Tejas Shah’s easy script to list the date of all weekdays or weekends of a year with a recursive CTE, first written to find every Sunday of 2010.

Read More
Temp Table and Table Variable execution differences.

SQL SERVER – Difference Temp Table and Table Variable – Effect of Transaction

December 28, 2009
Pinal Dave
SQL Performance
Best Practices, Database, SQL Scripts, SQL Transactions

Temp table versus table variable, part two: a transaction rollback undoes changes to a temp table, but a table variable keeps its values.

Read More
SQL SERVER - CDC and TRUNCATE - Cannot truncate table because it is published for replication or enabled for Change Data Capture

SQL SERVER – CDC and TRUNCATE – Cannot truncate table because it is published for replication or enabled for Change Data Capture

December 25, 2009
Pinal Dave
SQL Tips and Tricks
Change Data Capture, SQL Error Messages, SQL Scripts, SQLAuthority Author Visit

Does CDC capture a TRUNCATE? No. On a table enabled for Change Data Capture you get Msg 4711: Cannot truncate table. I recreate the error step by step.

Read More
Detailed painting of three wooden reading trays, each containing the same stack of five colored books, in a warm private library.

Prefix Searches: LIKE, LEFT and CHARINDEX

December 24, 2009
Pinal Dave
SQL Performance
SQL Index, SQL Performance, SQL Scripts, SQL Server

LIKE, LEFT and CHARINDEX can match the same prefix through different access paths. Compare complete matching rows and measured plans, then test literal wildcard characters and collation before choosing a search expression.

Read More
74954 records.

SQL SERVER – ORDER BY Clause and TOP WITH TIES

December 23, 2009
Pinal Dave
SQL Tips and Tricks
SQL Scripts

How does TOP WITH TIES work with ORDER BY? A simple example shows how WITH TIES returns the extra rows that match the value of the last row.

Read More
SQL Server query window.

SQL SERVER – Comma Separated Values (CSV) from Table Column – Part 2

December 21, 2009
Pinal Dave
SQL Tips and Tricks
Database, SQL Scripts, SQL String, SQL XML

Comma Separated Values from a table column, part 2: SUBSTRING limits the XML length, so I rewrote the query with STUFF and FOR XML PATH to remove it.

Read More
Gouache painting: from a greenhouse beam hang three iron hooks

XML exist: A Present Boolean Expression Still Exists

December 20, 2009
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

XML exist tests a nonempty XQuery result. Even false() returns a value, so use a node predicate to test presence and preserve NULL XML input.

Read More
Previous 1 … 270 271 272 273 274 275 276 … 365 Next
  • Books
  • Testimonials
  • Privacy Policy

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