CURRENT_TIMESTAMP is a standard SQL temporal function that yields the current date and time as a TIMESTAMP value. It is evaluated once per SQL statement, meaning every reference within the same statement returns an identical value. Some engines allow an optional fractional-seconds precision, which controls the number of digits shown after the decimal point for seconds. The value reflects the session time zone unless the database stores timestamps without zone data. Unlike GETDATE() or NOW(), CURRENT_TIMESTAMP is ANSI-compliant and portable across most relational databases. Because it is nondeterministic, it cannot be used in indexes or persisted computed columns in certain systems. In read-only or replicated environments, the timestamp is still generated by the executing server, not the source replica.
precision
(integer) - Optional. Number of fractional seconds digits (0-6 in most systems).CURRENT_DATE, CURRENT_TIME, LOCALTIMESTAMP, NOW(), GETDATE(), SYSDATETIME
SQL-92
It returns a TIMESTAMP or DATETIME type, depending on the database, including both date and time components.
Define the column with `DEFAULT CURRENT_TIMESTAMP` in the CREATE TABLE or ALTER TABLE statement. The database will populate the column automatically on insert.
The value reflects the session's time zone if the data type stores zone information. In databases that store it "without time zone", the literal does not carry zone data even though the clock uses the server time zone.
GETDATE() is SQL Server specific, while CURRENT_TIMESTAMP is ANSI standard and portable across multiple database systems.