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 - 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
A long cord of wooden beads tied to a brass ring, every seventh bead red, a fingertip on the first

Finding the First Monday of Every Month in T-SQL

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

Calculate the first Monday without DATEFIRST, list a full year, find nth and last weekdays, and reuse the rules in an inline table function.

Read More
Hands fitting old wooden drawers into a new cabinet, one drawer too wide to slide into its opening

Mapping MySQL Data Types to SQL Server

February 19, 2010
Pinal Dave
SQL Tips and Tricks
MySQL, SQL Datatype, SQL DateTime, SQL Migration, SQL Server

Mapping MySQL data types requires checking signed ranges, text encoding, date limits, and application behavior before choosing SQL Server columns.

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
Gouache painting: two chains of equal length are pinned between the same pair of wooden posts

DATETIME2FROMPARTS: Match Fractions to Precision

December 26, 2009
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Server

DATETIME2FROMPARTS constructs a complete typed timestamp. Match fraction units to precision and preserve valid calendar components.

Read More
Gouache painting: beside the bag on a wooden board lies a second pretzel that is almost whole, missing only a small torn piece from one arm

DATEADD Fractional Numbers: Truncate Before Addition

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

DATEADD fractional numbers are truncated, not rounded. Compare positive and negative day additions while preserving an explicitly typed date input.

Read More
Beach towels laid edge to edge on the sand, seen from above, one red towel overlapping its neighbor

Preventing Overlapping Date Ranges in a Table

October 31, 2009
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL DateTime, SQL Server, SQL Transactions, SQL Trigger

Detect overlapping date ranges with joins and window queries, use half-open endpoints, and enforce the rule with a multirow trigger.

Read More
Previous 1 … 18 19 20 21 22 23 24 … 29 Next
  • Books
  • Testimonials
  • Privacy Policy

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