Error using liquibase on SQL Server

I am experimenting with Liquibase trying to get it to copy one database to another. Sorry, I keep getting this error:

Implicit conversion from varchar to varbinary data type is prohibited. Use the CONVERT function to run this query.

The SQL generator created here:

CREATE TABLE [dbo].[Attachment] (
    [Applicantid] uniqueidentifier NOT NULL, 
    [Attachmentid] uniqueidentifier CONSTRAINT DF_Attachment_Attachmentid DEFAULT '(newid())' NOT NULL, 
    [AttachmentType] INT CONSTRAINT DF_Attachment_AttachmentType DEFAULT 0 NOT NULL, 
    [FileAttachment] image NOT NULL, 
    [FileName] ntext NOT NULL, 
    [FileType] nvarchar(125) NOT NULL, 
    [Filesize] INT NOT NULL, 
    [CCN] varbinary(8) CONSTRAINT DF_Attachment_CCN DEFAULT '0' NOT NULL, 
    [CreateDate] DATETIME CONSTRAINT DF_Attachment_CreateDate DEFAULT (getdate()) NOT NULL, 
    [LastUpdate] DATETIME CONSTRAINT DF_Attachment_LastUpdate DEFAULT (getdate()) NOT NULL, 
    CONSTRAINT [PK_Attachment] PRIMARY KEY (Attachmentid)
  ):
+3
source share
1 answer

The guys from the Liquibase project need to learn a few things about later versions of SQL Server 2005 and higher:

  • NTEXT long out of date - use instead NVARCHAR(MAX)
  • IMAGEtoo outdated - use VARBINARY(MAX)instead

(these data types will be fine if you are dealing with SQL Server 2000 or earlier, however).

: , . () , , Liquibase ? : // SQL, ?

, varchar, varbinary ...

+2

Source: https://habr.com/ru/post/1769407/


All Articles