TSQLT 单元测试

编程入门 行业动态 更新时间:2024-10-13 18:24:37
本文介绍了TSQLT 单元测试 - 数据类型文本和文本在等于运算符中不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 AssertEqualsTable 收到此错误数据类型文本和文本在等于运算符中不兼容."

I am getting this error from AssertEqualsTable "The data types text and text are incompatible in the equal to operator."

然后

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

"The 'TableCompare' procedure attempted to return a status of NULL, which is not allowed. A status of 0 will be returned instead."

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]

推荐答案

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

I don't think you can compare text field values, which would explain the error.

此外,不推荐使用 text 数据类型,取而代之的是 varchar(MAX).

Also, the text data type is deprecated in favor of varchar(MAX).

请参阅此

这篇关于TSQLT 单元测试 - 数据类型文本和文本在等于运算符中不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-03-19 00:24:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/626207.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单元测试   TSQLT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!