NP007
NP007

Reputation: 688

How to change timezone of SQL server manage instance in azure?

I have created manage instance in azure using UTC timezone at time of creation. Now I want to change timezone to GMT. So is this any way to make timezone change of Manage instance SQL server?

Upvotes: 0

Views: 3294

Answers (2)

Shashikant Shakya
Shashikant Shakya

Reputation: 142

This can't be changed once managed instance is created. You need to redeploy managed instance with correct timestamp and use cross instance PITR to move databases.

Upvotes: 1

Leon Yue
Leon Yue

Reputation: 16431

The date/time is derived from the operating system of the computer on which the instance of SQL Server is running.

I searched a lot and according my experience , we can not change the timezone once the SQL server instance is created.

The only thing we can to is convert the UTC timezone to GMT. Many people has post similar problem on Stack overflow. Such as:

  1. Date time conversion from timezone to timezone in sql server
  2. SQL Server Timezone Change

Azure gives the built-in function AT TIME ZONE (Transact-SQL) applies to SQL Server 2016 or later. AT TIME ZONE implementation relies on a Windows mechanism to convert datetime values across time zones.

inputdate AT TIME ZONE timezone

For example, Convert values between different time zones:

USE AdventureWorks2016;  
GO  

SELECT SalesOrderID, OrderDate,   
    OrderDate AT TIME ZONE 'Pacific Standard Time' AS OrderDate_TimeZonePST,  
    OrderDate AT TIME ZONE 'Central European Standard Time' AS OrderDate_TimeZoneCET  
FROM Sales.SalesOrderHeader;

I don't have the Azure SQL MI, so I could test it for you.

Hope this helps.

Upvotes: 0

Related Questions