cancel
Showing results for 
Search instead for 
Did you mean: 

Query to get the current DB date, not server date

Former Member
0 Kudos

Hi,

We have few DB in one server, but each DB have different timezone.

How can I get the query to generate the current date in each DB?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

KennedyT21
Active Contributor
0 Kudos

Hi Olga Hu...

Use the GETDATE() syntax.

Regards

Kennedy

Answers (1)

Answers (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Try this query:

SELECT DB_NAME() AS DataBaseName,getdate()

Thanks & Regards,

Nagarajan