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
ROUND or truncate illustration, two pale blocks with rounded and trimmed edges on a blue mat.

ROUND or Truncate: Keep Decimal Width in View

February 24, 2008
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts, SQL Server

ROUND or truncate is a choice about the result, not its display format. This complete decimal example checks positive and negative values while preserving enough width for thousands.

Read More
SQL SERVER - Find All The User Defined Functions (UDF) - Part 2

SQL SERVER – Find All The User Defined Functions (UDF) – Part 2

February 22, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

Madhivanan shared another way to find all the user defined functions in a database, using information_schema.routines. Here is his short script.

Read More
SQL SERVER - UDF to Return a Calendar for Any Date for Any Year.

SQL SERVER – UDF to Return a Calendar for Any Date for Any Year

February 20, 2008
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

Reader Dan Golden built on my weekly calendar function to create a UDF to return a calendar for any date for any year. I fixed a small first and last week bug.

Read More
Gouache painting: on a calm river, three rows of flat stepping stones cross from the near bank to the same vermilion post on the far bank

LOG With a Base: Make the Calculation Explicit

February 15, 2008
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

LOG with a base makes logarithm meaning explicit. Compare base two, base ten and the natural default using typed, positive inputs.

Read More
Gouache painting: two identical wall rails each carry the same five horseshoes graded from small to large, plus two bare vermilion hooks

NULL Sort Order: Put Missing Values Where Readers Expect

February 8, 2008
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

NULL sort order uses a CASE bucket to put missing values last. Keep a stable tie breaker and preserve the original score.

Read More
Gouache painting: a garden bench seen from the front has five slat positions

CHAR: Invalid Character Codes Return NULL

February 7, 2008
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Server

CHAR constructs a character instead of printing an integer. Preserve byte-code inputs and distinguish an ordinary space from missing output.

Read More
SQL SERVER - Find All The User Defined Functions (UDF) in a Database

SQL SERVER – Find All The User Defined Functions (UDF) in a Database

February 2, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

A very simple script that lists all the User Defined Functions in a database, with schema name and type, by reading sys.objects in SQL Server.

Read More
Previous 1 … 72 73 74 75 76 77 78 … 92 Next
  • Books
  • Testimonials
  • Privacy Policy

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