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
ISDATE function in SQL Server.

SQL SERVER – Validate Field For DATE datatype using function ISDATE()

July 12, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

A CSV import crashed on the date 30/2/2007. Use the ISDATE() function to validate a VARCHAR column in a staging table before moving rows to a DATETIME field.

Read More
SQL SERVER - 2005 - List All Stored Procedure Modified in Last N Days

SQL SERVER – 2005 – List All Stored Procedure Modified in Last N Days

July 10, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Scripts, SQL Stored Procedure

A query on sys.objects to list every stored procedure modified in last N days, or ones created lately. I use 7 days; change it to what you need.

Read More
Gouache painting of three differently shaped hourglasses on a stone garden wall, the middle one with red sand

Current Date and Time in SQL Server: GETDATE, SYSDATETIME and More

June 21, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

You can read the current date and time in SQL Server in eight ways, and they differ in precision and time zone. This post runs them side by side, shows that each one is evaluated once per statement, and picks the right one for defaults, audit columns and reports.

Read More
SQL SERVER - Delay Function - WAITFOR clause - Delay Execution of Commands

SQL SERVER – Delay Function – WAITFOR clause – Delay Execution of Commands

June 18, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

The WAITFOR clause delays a batch, stored procedure or transaction until a set time or for an interval. I use it daily after restores. DELAY and TIME examples.

Read More
Gouache illustration for the date part example: a fern and its simplified outline beside a wooden press.

SQL SERVER – Retrieve – Select Only Date Part From DateTime – Best Practice

June 10, 2007
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL DateTime, SQL Function, SQL Scripts, SQL Server

Selecting the date part and formatting it are different tasks. I keep typed dates for calculations and text for display.

Read More
SQL SERVER - UDF - Function to Display Current Week Date and Day - Weekly Calendar

SQL SERVER – UDF – Function to Display Current Week Date and Day – Weekly Calendar

June 8, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

A script and UDF that show each current week date with its day, from Sunday to Saturday, using DATEPART and DATEADD. Handy for a weekly calendar report.

Read More
SQL SERVER - Script/Function to Find Last Day of Month

SQL SERVER – Script/Function to Find Last Day of Month

May 20, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Utility

A one line DATEADD query to find the last day of month for any date. It handles leap years: February 2008 gives the 29th and 2007 the 28th.

Read More
Previous 1 … 25 26 27 28 29 Next
  • Books
  • Testimonials
  • Privacy Policy

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