Advent of 2025, Day 19 – SQL Server 2025 – New T-SQL functions – CURRENT_DATE

In this Microsoft SQL Server 2025 series:

  1. Dec 01: Microsoft SQL Server 2025 – Introduction and installation
  2. Dec 02: Microsoft SQL Server 2025 – New T-SQL functions – native JSON data type and some functions
  3. Dec 03: Microsoft SQL Server 2025 – New T-SQL functions – JSON Index
  4. Dec 04: Microsoft SQL Server 2025 – New T-SQL functions – Product()
  5. Dec 05: Microsoft SQL Server 2025 – New T-SQL functions – BASE64_ENCODE() and BASE64_DECODE()
  6. Dec 06: Microsoft SQL Server 2025 – New T-SQL functions – REGEXP_LIKE()
  7. Dec 07: Microsoft SQL Server 2025 – New T-SQL functions – REGEXP_SUBSTR() and REGEXP_REPLACE()
  8. Dec 08: Microsoft SQL Server 2025 – New T-SQL functions – REGEXP_INSTR() and REGEXP_COUNT()
  9. Dec 09: Microsoft SQL Server 2025 – New T-SQL functions – REGEXP_MATCHES() and REGEXP_SPLIT_TO_TABLE()
  10. Dec 10: Microsoft SQL Server 2025 – External REST endpoint invocation
  11. Dec 11: Microsoft SQL Server 2025 – External REST endpoint invocation using LLM
  12. Dec 12: Microsoft SQL Server 2025 – New vector data type and Vector functions
  13. Dec 13: Microsoft SQL Server 2025 – Vector functions
  14. Dec 14: Microsoft SQL Server 2025 – Vector arrays or embeddings with function AI_GENERATE_EMBEDDINGS
  15. Dec 15: Microsoft SQL Server 2025 – T-SQL functions for AI External_Models, Chunks and Embeddings
  16. Dec 16: Microsoft SQL Server 2025 – Optional parameter plan optimization (OPPO)
  17. Dec 17: Microsoft SQL Server 2025 – Query hint ABORT_QUERY_EXECUTION
  18. Dec 18: Microsoft SQL Server 2025 – Optimized locking

This function returns the current database system date as a date value, without the database time and time zone offset. CURRENT_DATE derives this value from the underlying operating system on the Database Engine runs. This function is eqvivalent to CAST(GETDATE() AS DATE).

Let’s check the precisions to see, where we will lose the precision based on the system date/datetime functions.

SELECT CURRENT_DATE;
GO

-- precisions
SELECT 
		 SYSDATETIME() AS Sys_datetime
		,SYSDATETIMEOFFSET() AS sys_DatetimeOffset
		,SYSUTCDATETIME() AS SysUTC_Datetime
		,CURRENT_TIMESTAMP AS Curr_Timestamp
		,GETDATE() AS Get_date
		,GETUTCDATE() as Get_UTCDate
		,CURRENT_DATE AS current_d
		,CAST(GETDATE() AS DATE) as current_d_cast

Function current_date can be used also as default when creating a table:

DROP TABLE IF EXISTS dbo.TEST;
GO

CREATE TABLE dbo.test
(ID INT IDENTITY(1,1) NOT NULL
,tt CHAR(10) NULL
,dd DATE NOT NULL DEFAULT CURRENT_DATE
,ddtt SMALLDATETIME NOT NULL DEFAULT DATEADD(DAY,1,CURRENT_DATE)
)

INSERT INTO dbo.test (tt, dd)
SELECT 'aaa','2025-12-19' UNION ALL
SELECT 'bbb','2025-12-20 05:26:46.947' UNION ALL
SELECT 'ccc',GETDATE() UNION ALL
SELECT 'ddd',DATEADD(DAY, 8,CAST(GETDATE() AS DATE)) union all
select 'eee',CURRENT_TIMESTAMP 

SELECT * FROM dbo.TEST

where current date and time (of making this test was: 19th December 2025, 06.20 AM CET).

Tomorrow we will look into the new CES feature in SQL Server 2025.

As always, the code is available at my Github: https://github.com/tomaztk/SQLServer2025

Happy coding!

Tagged with: , , ,
Posted in SQL Server
5 comments on “Advent of 2025, Day 19 – SQL Server 2025 – New T-SQL functions – CURRENT_DATE
  1. […] Dec 19: Microsoft SQL Server 2025 – New T-SQL functions – CURRENT_DATE […]

    Like

  2. […] Dec 19: Microsoft SQL Server 2025 – New T-SQL functions – CURRENT_DATE […]

    Like

  3. […] Dec 19: Microsoft SQL Server 2025 – New T-SQL functions – CURRENT_DATE […]

    Like

  4. […] Dec 19: Microsoft SQL Server 2025 – New T-SQL functions – CURRENT_DATE […]

    Like

Leave a comment

Follow TomazTsql on WordPress.com
Programs I Use: SQL Search
Programs I Use: R Studio
Programs I Use: Plan Explorer
Rdeči Noski – Charity

Rdeči noski

100% of donations made here go to charity, no deductions, no fees. For CLOWNDOCTORS - encouraging more joy and happiness to children staying in hospitals (http://www.rednoses.eu/red-noses-organisations/slovenia/)

€2.00

Top SQL Server Bloggers 2018
TomazTsql

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

Discover WordPress

A daily selection of the best content published on WordPress, collected for you by humans who love to read.

Revolutions

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

Reeves Smith's SQL & BI Blog

A blog about SQL Server and the Microsoft Business Intelligence stack with some random Non-Microsoft tools thrown in for good measure.

SQL Server

for Application Developers

Business Analytics 3.0

Data Driven Business Models

SQL Database Engine Blog

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

Search Msdn

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

R-bloggers

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

Data Until I Die!

Data for Life :)

Paul Turley's SQL Server BI Blog

sharing my experiences with the Microsoft data platform, Fabric, enterprise Power BI, SQL Server BI, Data Modeling, SSAS Design, SSRS, Dashboards & Visualization since 2009

Grant Fritchey

Intimidating Databases and Code

Madhivanan's SQL blog

A modern business theme

Alessandro Alpi's Blog

DevOps could be the disease you die with, but don’t die of.

Paul te Braak

Business Intelligence Blog

Sql Insane Asylum (A Blog by Pat Wright)

Information about SQL (PostgreSQL & SQL Server) from the Asylum.

Gareth's Blog

A blog about Life, SQL & Everything ...

SQLPam's Blog

Life changes fast and this is where I occasionally take time to ponder what I have learned and experienced. A lot of focus will be on SQL and the SQL community – but life varies.

William Durkin

William Durkin a blog on SQL Server, Replication, Performance Tuning and whatever else.

$hell Your Experience !!!

As aventuras de um DBA usando o Poder do $hell

Design a site like this with WordPress.com
Get started