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
Gouache painting of a xylophone with one new red bar fitted into the middle of the row

How to Add Column at Specific Position in SQL Server

March 11, 2013
Pinal Dave
SQL Tips and Tricks
SQL Column, SQL Scripts, SQL Server, SQL Server Management Studio

To add column at specific position in SQL Server, you have three tested options, because ALTER TABLE always adds the column last. This post shows a SELECT list, a view for loads and reports, and a full table rebuild. It also explains what the rebuild costs.

Read More
SQL SERVER - Check If String is a Palindrome in Using T-SQL Script - Reverse Function

SQL SERVER – Check If String is a Palindrome in Using T-SQL Script – Reverse Function

March 7, 2013
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL String

A friend building a captcha had to skip words that read the same backward. Here is a T-SQL script with REVERSE to check if a string is a Palindrome.

Read More
Solder sucker beside a recovered original bead and a separate new lump

Rethrowing Errors With THROW and Keeping the Original Number

March 6, 2013
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Server

A bare THROW passes an error on untouched. A new THROW or a copied RAISERROR message does not. See the proof, plus one semicolon trap.

Read More
SQL SERVER - SSMS Does NOT Print NULL Values

SQL SERVER – SSMS Does NOT Print NULL Values

March 4, 2013
Pinal Dave
SQL Tips and Tricks
SQL NULL, SQL Scripts, SQL Server, SQL Server Management Studio

Here is a very interesting question asked on the blog by Karthik. I really liked the question and I would like to discuss this here about SSMS doe snot Print NULL values. 

Read More
Two boxes. The path /Library/Book in nodes() returns 3 rows, one per book. The path /Library/Book/Reviewer returns 5 rows, one per reviewer, each with its BookID, rank and reviewer name

nodes() Method in SQL Server: Aliases and Row Patterns

March 1, 2013
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL XML

The nodes() method turns each element at a path into one row you can query. This post builds a small catalog of books and reviewers, and shows the two alias errors, query() against value(), the singleton rule, how the row pattern decides the rows, and CROSS APPLY for the next level. Every result comes from SQL Server 2025.

Read More
A table of FORMAT strings for 2024-08-12: MMMM gives August, MMM gives Aug, MM gives 08. Beside it, for 9:22:38 pm, MM gives 10, mm gives 22, HH gives 21, hh gives 09 and ss gives 38

Custom Date Format Strings in SQL Server: MM Is Not mm

February 28, 2013
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

Custom date format strings tell FORMAT exactly which parts of a date to show. This post compares CONVERT styles with FORMAT, lists the standard and custom letters, and shows the traps: MM against mm, YYYY against yyyy, month names that sort wrong, and a culture that changes with the session. Every result comes from SQL Server 2025.

Read More
Gouache painting of a circular wooden card carousel feeding a selected blue card into a separate tray.

Cycle Clipboard Ring in SSMS: SQL in Sixty Seconds #045

February 27, 2013
Pinal Dave
SQL Video
SQL in Sixty Seconds, SQL Scripts, SQL Server Management Studio, SQL Shortcut

To cycle clipboard ring entries in SSMS, press Ctrl+Shift+V after a paste. The clipboard ring is most useful when you copy several names, so this post uses T-SQL to build clean column lists and tests the QUOTENAME and STRING_AGG limits that break a paste.

Read More
Previous 1 … 190 191 192 193 194 195 196 … 363 Next
  • Books
  • Testimonials
  • Privacy Policy

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