I need to use sysdate in both Oracle and SQL Server, but SQL Server has a GETDATE() function instead.
But I don't want to create 2 separate queries
Is there any specific common syntax which gives same output to sysdate and getdate in SQL Server and oracle
CURRENT_TIMESTAMP
is valid syntax for both SQL Server and Oracle. Oracle will return the current date and time in the session time zone. SQL Server will return the current date and time of the Operating System
You could also just alias it in t-sql to match Oracle's function?
CREATE FUNCTION sysdate ()
RETURNS DATETIME
AS
BEGIN
RETURN getdate()
END
GO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With