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 Unpivot Table.

SQL SERVER – UNPIVOT Table Example

May 29, 2008
Pinal Dave
SQL Tips and Tricks
PIVOT and UNPIVOT, SQL Function, SQL Scripts

UNPIVOT Table is the reverse of PIVOT. This AdventureWorks example turns state columns back into rows, and shows why the detail rows do not return.

Read More
SQL SERVER - SQL SERVER - UDF - Get the Day of the Week Function - Part 3

SQL SERVER – SQL SERVER – UDF – Get the Day of the Week Function – Part 3

May 27, 2008
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

Nanda Kumar improved the UDF to get the day of the week: it now uses the date you pass in instead of GETDATE() and handles Saturday correctly.

Read More
A SQL Server message window.

SQL SERVER – T-SQL Script to Devide One Column into Two Column

May 25, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

A quick script to split one column into two with LEFT, RIGHT and CHARINDEX, plus what to check when a value has no comma or has extra spaces.

Read More
SQL SERVER - SQL SERVER - UDF - Get the Day of the Week Function - Part 2

SQL SERVER – SQL SERVER – UDF – Get the Day of the Week Function – Part 2

May 23, 2008
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

Mihir Popat improved my Day of the Week Function with @@DATEFIRST, so Sunday does not have to be the first day of the week. Here is his UDF.

Read More
A clear tumbler and a corked glass bottle with a sage ribbon on warm paper.

STRING_ESCAPE JSON Text: Escaping Is Not Serialization

May 20, 2008
Pinal Dave
SQL Tips and Tricks
JSON, SQL Function, SQL Server, SQL String

STRING_ESCAPE JSON text is still text that belongs inside a JSON string. This example compares quotations, backslashes and a newline with complete FOR JSON PATH objects.

Read More
Gouache painting: a short wooden rack holds eight cream balls in one row

Bit Shifts: Move Bits Without Rotating Them

May 16, 2008
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

Bit shifts fill vacant positions with zero and discard bits past the type width. Compare tinyint with int and a negative shift direction.

Read More
SQL SERVER - Function Property - Deterministic or Non-Deterministic

SQL SERVER – Function Property – Deterministic or Non-Deterministic

May 10, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

How do you tell if a user defined function is deterministic or non-deterministic? One OBJECTPROPERTY call with IsDeterministic gives you the answer.

Read More
Previous 1 … 68 69 70 71 72 73 74 … 92 Next
  • Books
  • Testimonials
  • Privacy Policy

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