Cannot build automation project with MEMORY_OPTIMIZED types

I'm trying to build a change automation project with schema changes which create types marked as MEMORY_OPTIMIZED.
When building the project, I get a syntax error for the generated migration script:

Error:  : Incorrect syntax near (.
(This points to the open bracket after the WITH keyword)


The migration script looks like this:

...
IF TYPE_ID(N'[dbo].[ServiceList]') IS NULL
CREATE TYPE [dbo].[ServiceList] AS TABLE
(
[service_id] [uniqueidentifier] NOT NULL,
[service_type] [varchar] (20) COLLATE Latin1_General_CI_AS NOT NULL,
[is_newconn] [bit] NOT NULL,
[allow_multiparty] [bit] NOT NULL,
[service_params] [nvarchar] (max) COLLATE Latin1_General_CI_AS NOT NULL,
[server_type] [varchar] (20) COLLATE Latin1_General_CI_AS NOT NULL,
[searchfield] [nvarchar] (100) COLLATE Latin1_General_CI_AS NOT NULL,
PRIMARY KEY NONCLUSTERED  ([service_id])
)
WITH
(
MEMORY_OPTIMIZED = ON
)
...


Tagged:

Answers

  • Hi @dmlinkbit,

    What version of SQL Change Automation are you using and is this during the build of the .sqlproj file within Visual Studio or from the building of that project using the PowerShell cmdlets?

    Can you share the PowerShell script you are using and/or how you have the addins configured?

    I've tried to recreate the apparent parsing error but I only got issues related to the database the build was occurring on not having a memory optimized filegroup online with a file (and I had to disable transactions as well).

    Kind regards,
    Alex
    Product Support Engineer | Redgate Software

    Have you visited our Help Center?
Sign In or Register to comment.