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
Results window of join fails join.

SQL SERVER – Difference Between DATETIME and DATETIME2

June 11, 2010
Pinal Dave
SQL Performance
SQL DateTime, SQL Scripts

A developer filled a DATETIME and a DATETIME2 column with the same value and got different results. Here is the difference between DATETIME and DATETIME2.

Read More
SQL SERVER - Difference Between GETDATE and SYSDATETIME

SQL SERVER – Difference Between GETDATE and SYSDATETIME

June 10, 2010
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Scripts

What is the difference between GETDATE and SYSDATETIME? GETDATE stops at milliseconds, while SYSDATETIME in SQL Server 2008 goes much finer.

Read More
SQL SERVER – Precision of SMALLDATETIME – A 1 Minute Precision

SQL SERVER – Precision of SMALLDATETIME – A 1 Minute Precision

June 1, 2010
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Scripts

The precision of SMALLDATETIME is 1 minute. Seconds are rounded up or down to the nearest minute, and this simple example shows exactly how.

Read More
SQL SERVER - DATE and TIME in SQL Server 2008

SQL SERVER – DATE and TIME in SQL Server 2008

May 27, 2010
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Scripts, SQL Server

What happens when you convert DATE and TIME in SQL Server 2008 to DATETIME? A quick demo shows the midnight and 1900 surprise.

Read More
SQL SERVER - Get Date of All Weekdays or Weekends of the Year

SQL SERVER – Get Date of All Weekdays or Weekends of the Year

December 29, 2009
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

Tejas Shah’s easy script to list the date of all weekdays or weekends of a year with a recursive CTE, first written to find every Sunday of 2010.

Read More
Calendar with check mark icon.

SQL SERVER – Get Time in Hour:Minute Format from a Datetime – Get Date Part Only from Datetime

August 6, 2009
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

Get the time in Hour:Minute Format, or just the date, from a DATETIME with CONVERT styles 108 and 101, or with the TIME and DATE types in SQL Server 2008.

Read More
A SQL Server query in a window.

SQL SERVER – Find Last Date Time Updated for Any Table

May 9, 2009
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Scripts, SQL Table Operation

Want the last date time a table was updated without an UpdatedDate column? The sys.dm_db_index_usage_stats DMV shows it. A quick demo on AdventureWorks.

Read More
Previous 1 … 11 12 13 14 15 16 17 … 19 Next
  • Books
  • Testimonials
  • Privacy Policy

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