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 - Difference Between ORIGINAL_LOGIN() and SUSER_SNAME()

SQL SERVER – Difference Between ORIGINAL_LOGIN() and SUSER_SNAME()

July 28, 2012
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

What is the difference between ORIGINAL_LOGIN() and SUSER_SNAME()? A quick script with context switching shows when the two return different logins.

Read More
SQL SERVER - Answer - How to Convert Hex to Decimal or INT

SQL SERVER – Answer – How to Convert Hex to Decimal or INT

July 26, 2012
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

Readers sent great answers on how to convert Hex to Decimal or INT in SQL Server. Here are their solutions, with due credit, using 0x00000100 as the example.

Read More
Two shoes sit immediately on opposite sides of a narrow doorway threshold strip

DATEDIFF Counts Boundaries, Not Time: Getting Durations Right

July 10, 2012
Pinal Dave
SQL Tips and Tricks
Mathematics, SQL DateTime, SQL Function, SQL NULL

A report can say one year of service after a single day. Here is why DATEDIFF does that, and what to use instead.

Read More
SQL Server Spatial object invalid due to overlapping edges.

SQL SERVER – Validating Spatial Object as NULL using IsNULL

June 30, 2012
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function

How do spatial functions handle NULL? I show two ways of validating a spatial object as NULL: the IsNULL method, which returns 0 or NULL, and IsValidDetailed.

Read More
SQL SERVER - Introduction to Function SIGN

SQL SERVER – Introduction to Function SIGN

June 23, 2012
Pinal Dave
SQL Tips and Tricks
SQL Function

The SIGN function returns 1, -1 or 0 depending on whether a value is positive, negative or zero. A simple example with INT and DECIMAL values.

Read More
SQL SERVER - Solution of Puzzle - Swap Value of Column Without Case Statement

SQL SERVER – Solution of Puzzle – Swap Value of Column Without Case Statement

June 14, 2012
Pinal Dave
SQL Puzzle
SQL Function, SQL Scripts

Readers sent more than 50 answers to my swap puzzle. Here are 5 different ones that swap a column value without CASE statement, plus my own three.

Read More
A pottery rib shapes a clay vessel beside a trimmed clay strip and a newly attached clay handle

XML modify(): Inserting, Replacing and Deleting Nodes

May 11, 2012
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Table Operation, SQL Variable, SQL XML

The modify() method edits XML in place, but a path that matches nothing changes nothing and says nothing. Here is how to stay in control.

Read More
Previous 1 … 35 36 37 38 39 40 41 … 92 Next
  • Books
  • Testimonials
  • Privacy Policy

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