AT TIME ZONE not working?

Creating a table like this:

CREATE TABLE TimezoneTest
(
   utctime DATETIME2(2) NOT NULL
 , starttime AS CAST(utctime AT TIME ZONE 'UTC' AT TIME ZONE 'W. Europe Standard Time' AS DATETIME2(2))
);


Works fine, but SQL Compare 13.2.1.5640 generates invalid code like this when comparing:
CREATE TABLE [dbo].[TimezoneTest]
(
   [utctime] [datetime2] (2) NOT NULL,
   [starttime] AS (CONVERT([datetime2](2), AT TIME ZONE  AT TIME ZONE ,(0)))
) ON [PRIMARY]

// Henrik
Tagged:

Answers

Sign In or Register to comment.