What are the challenges you face when working across database platforms? Take the survey

AT TIME ZONE not working?

Creating a table like this:

   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 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)))

// Henrik


  • Options
    RichardLRichardL Posts: 417 Gold 4

    Hi @henrik_ffc

    Thanks for your post. 


    This looks like a question that one of Support engineers will need to investigate for you.


    If you've a got support contract, please send us a ticket. Provide as much information as you can - screenshots of any errors, log files etc – so we can help you as fast as possible.

    If you're not covered by a Support contract at the moment, email our Sales team at sales@red-gate.com, and they'll be able to help.

    Customer Support
    Redgate Software
Sign In or Register to comment.