对数据类型而言运算符无效。运算符为 add,类型为 uniqueidentifier。
declare @sa uniqueidentifier
set @sa='1'
declare @s uniqueidentifier
declare tb cursor local for
select s='if exists(select 1 from ['+b.name+'] where ['+a.name+'] like ''%'+@sa+'%'')
print ''所在的表及字段: ['+b.name+'].['+a.name+']'''
from syscolumns a join sysobjects b on a.id=b.id
where b.xtype='U' and a.status>=0
and a.xusertype in(175,239,231,167)
open tb
fetch next from tb into @s
while @@fetch_status=0
begin
exec(@s)
fetch next from tb into @s
end
close tb
deallocate tb
报错:
服务器: 消息 403,级别 16,状态 1,行 6
对数据类型而言运算符无效。运算符为 add,类型为 uniqueidentifier。
set @sa='1'
declare @s uniqueidentifier
declare tb cursor local for
select s='if exists(select 1 from ['+b.name+'] where ['+a.name+'] like ''%'+@sa+'%'')
print ''所在的表及字段: ['+b.name+'].['+a.name+']'''
from syscolumns a join sysobjects b on a.id=b.id
where b.xtype='U' and a.status>=0
and a.xusertype in(175,239,231,167)
open tb
fetch next from tb into @s
while @@fetch_status=0
begin
exec(@s)
fetch next from tb into @s
end
close tb
deallocate tb
报错:
服务器: 消息 403,级别 16,状态 1,行 6
对数据类型而言运算符无效。运算符为 add,类型为 uniqueidentifier。
...全文
相关推荐
uniqueidentifier转换成varchar数据类型的sql语句
uniqueidentifier转换成varchar数据类型的sql语句,需要的朋友可以参考下。
创建 uniqueidentifier 类型的唯一值
下面的示例使用 NEWID 对声明为 uniqueidentifier 数据类型的变量赋值。在测试该值前,将先打印 uniqueidentifier 数据类型变量的值。
解决sql server保存对象字符串转换成uniqueidentifier失败的问题
一、 背景介绍 web应用采用的是ssh框架,数据库使用的sql server2014版本。 二、问题: 客户要求,ID列的数据类型必须是uniqueidentifier,一开始实体类的ID设计成java.lang.String类型;映射文件中ID的增长方式是uuid.hex private java.lang.String id; public java.lang.String getId(){ return id; } public void setId(java.lang.String id){ this.id=id; } <id name="id" column="ID" ty
sqlserver数据库类型对应Java中的数据类型
sqlserver数据库类型对应Java中的数据类型
SqlServer中Int类型快速转uniqueidentifier
SqlServer中Int类型快速转uniqueidentifier


疑难问题
