Alex Rivera | Logout

What is the common sql for sysdate and getdate()

Asked 2012-10-19T16:52:48.057
9

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

Edit
Report

1 Answer

3

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
answered 2012-10-20T10:37:50.910

Your Answer