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 - Adding Column Defaulting to Current Datetime in Table

SQL SERVER – Adding Column Defaulting to Current Datetime in Table

May 10, 2013
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Scripts, SQL Server

How do you add a column that fills in the current datetime when a row is inserted? A sample table and a column with a default value that does it for you.

Read More
A lazy susan with seven colored bowls, including a red one, around a ring.

Weekday Logic That Works Under Any DATEFIRST Setting

April 27, 2013
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

Make weekday logic independent of DATEFIRST with a normalized offset or a known Monday, then test every date in a full year.

Read More
SQL SERVER - TRIM Function to Remove Leading and Trailing Spaces of String - SQL in Sixty Seconds #040 - Video

SQL SERVER – TRIM Function to Remove Leading and Trailing Spaces of String – SQL in Sixty Seconds #040 – Video

January 23, 2013
Pinal Dave
SQL Video
Database, SQL DateTime, SQL Function, SQL in Sixty Seconds, SQL Scripts, SQL Server, SQL Server Management Studio

SQL Server has no TRIM function, and calling it gives error Msg 195. This SQL in Sixty Seconds video shows how to remove leading and trailing spaces without it.

Read More
A stone sundial in a walled garden at midday with a crisp shadow, a trowel and a basket of cut flowers on its plinth.

Designing a Date Dimension

January 20, 2013
Pinal Dave
SQL Tips and Tricks
Business Intelligence, Data Warehousing, SQL DateTime, SQL Server

A date dimension makes reporting calendars explicit with fiscal periods, holidays, weekdays, and a repeatable SQL Server build script.

Read More
Getdate with currenttimestamp comparison.

SQL SERVER – Difference Between CURRENT_TIMESTAMP and GETDATE() – CURRENT_TIMESTAMP Equivalent in SQL Server

December 20, 2012
Pinal Dave
SQL Tips and Tricks
SQL DateTime

Is there a difference between CURRENT_TIMESTAMP and GETDATE()? No. One is ANSI SQL and the other is the T-SQL version, and both return the same value.

Read More
A wall key rack with five keys, two empty hooks and one hook tied with a red ribbon

A Calendar Table With Holidays for Date Math

December 6, 2012
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Scripts, SQL Server

Build a calendar table with weekdays, fiscal months, and American holiday flags, then count working days and find useful date boundaries.

Read More
SQL SERVER - Fix Error: Microsoft OLE DB Provider for SQL Server error '80040e07' or Microsoft SQL Native Client error '80040e07'

SQL SERVER – Fix Error: Microsoft OLE DB Provider for SQL Server error ‘80040e07’ or Microsoft SQL Native Client error ‘80040e07’

December 3, 2012
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Error Messages

Error 80040e07, syntax error converting datetime from character string, usually means a bad date value. In one case a reader had simply misspelled September.

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

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