TSQLT单元测试-在等于运算符中,数据类型text和text不兼容



我从AssertEqualsTable中得到此错误"在等于运算符中,数据类型text和text不兼容。"

然后

"TableCompare过程试图返回NULL状态,这是不允许的。将返回0状态。"

select   *
    into #Actual
    from [dbo].[InvoiceOut];
--make expected table an empty table of #actual's structure because we truncate so it should be empty.
    SELECT TOP(0) *
    INTO #Expected
    FROM #Actual;
EXEC tSQLt.AssertEqualsTable '#Expected', '#Actual';

--部分相关表格信息

CREATE TABLE [dbo].[InvoiceOut](
...
    [InsertField] [text] NULL,
    [DeductibleText] [text] NULL,
    [BarcodeText] [text] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

我不认为您可以比较文本字段值,这可以解释错误。

此外,文本数据类型也被弃用,取而代之的是varchar(MAX)。

请参阅此

最新更新