Varchar(max) 在 SQL Server Management Studio 中显示为文本
Varchar(max) showing as text in SQL Server Management Studio
我的数据库中有两列 运行ning 在 SQL Server 2008R2(10.50.4000) 上,它们是 varchar(max),但在 SQL Server Management Studio 中(11.0.5343.0) 它们在资源管理器中显示为文本 window。
当我运行查询
SELECT DISTINCT
J.TICKETID,
J.jobNotes,
J.jobScopeOfWork
FROM
sysdba.ALX_JOB J
JOIN
sysdba.ALX_JOBTYPE T ON J.JOBTYPEID = T.ALX_JOBTYPEID
JOIN
sysdba.ALX_JOBSTATUS S ON J.STATUSID = S.ID
JOIN
sysdba.ADDRESS A ON J.ADDRESSID = A.ADDRESSID
LEFT OUTER JOIN
sysdba.ALX_JOB_JOBUSERS ju ON j.TICKETID = ju.ticketId
WHERE
(ju.ALX_USERID = '12345' OR j.UserID = 12345)
我收到错误
Msg 421, Level 16, State 1, Line 1
The text data type cannot be selected as DISTINCT because it is not comparable.
Msg 421, Level 16, State 1, Line 1
The text data type cannot be selected as DISTINCT because it is not comparable.
兼容性选项设置如下
如果您的数据库 引擎 在 SQL Server 2000 上 运行,或者如果您的数据库 兼容级别 设置为“80”(SQL Server 2000),那么该数据库还不知道 varchar(max)
。
将您的兼容级别更改为更新的版本!
我的数据库中有两列 运行ning 在 SQL Server 2008R2(10.50.4000) 上,它们是 varchar(max),但在 SQL Server Management Studio 中(11.0.5343.0) 它们在资源管理器中显示为文本 window。
当我运行查询
SELECT DISTINCT
J.TICKETID,
J.jobNotes,
J.jobScopeOfWork
FROM
sysdba.ALX_JOB J
JOIN
sysdba.ALX_JOBTYPE T ON J.JOBTYPEID = T.ALX_JOBTYPEID
JOIN
sysdba.ALX_JOBSTATUS S ON J.STATUSID = S.ID
JOIN
sysdba.ADDRESS A ON J.ADDRESSID = A.ADDRESSID
LEFT OUTER JOIN
sysdba.ALX_JOB_JOBUSERS ju ON j.TICKETID = ju.ticketId
WHERE
(ju.ALX_USERID = '12345' OR j.UserID = 12345)
我收到错误
Msg 421, Level 16, State 1, Line 1
The text data type cannot be selected as DISTINCT because it is not comparable.Msg 421, Level 16, State 1, Line 1
The text data type cannot be selected as DISTINCT because it is not comparable.
兼容性选项设置如下
如果您的数据库 引擎 在 SQL Server 2000 上 运行,或者如果您的数据库 兼容级别 设置为“80”(SQL Server 2000),那么该数据库还不知道 varchar(max)
。
将您的兼容级别更改为更新的版本!