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 - Preserve Leading Zero While Coping to Excel from SSMS

SQL SERVER – Preserve Leading Zero While Coping to Excel from SSMS

September 30, 2012
Pinal Dave
SQL Tips and Tricks
Excel, SQL Function, SQL Server

Want to preserve leading zero values when you paste SSMS results into Excel? The fix is in Excel: format the cells as Text first, and the zeros stay.

Read More
A tall boot beside a small open shoebox that holds only a small red paper star instead of the boot.

Why CAST to a Short VARCHAR Returns a Star Instead of an Error

September 20, 2012
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Server, SQL String

Understand why a short VARCHAR returns a star for an integer, compare Unicode errors and string truncation, and size conversions safely.

Read More
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
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
Previous 1 … 31 32 33 34 35 36 37 … 61 Next
  • Books
  • Testimonials
  • Privacy Policy

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