try:
select cast((select top 1 cast(colnamel1 as bigint) from table1) &
(select top 1 cast(colnamel2 as bigint) from table2) as varbinary) colname3 into table3
select cast((select top 1 cast(colnamel1 as bigint) from table1) &
(select top 1 cast(colnamel2 as bigint) from table2) as varbinary) colname3 into table3
insert into table3
select cast((select top 1 cast(colnamel1 as bigint) from table1) &
(select top 1 cast(colnamel2 as bigint) from table2) as varbinary) colname3
(selct l1 from t1)&(select top 1 t2 from t2)INSERT INTO t3 (l3)
(selct l1 from t1)^(select top 1 t2 from t2)INSERT INTO t3 (l3)
(selct l1 from t1)|(select top 1 t2 from t2)
另外如果l1和l2不等长,如l1为8000个字节,l2为50个字节
循环将l2与l1^,并将所得结果累进到l3中(每次增加50个字节)如何实现???
SQL好象无法做到吧?:(
insert into t3
select ( select cast( l1 as bigint) from t1) & (select cast(l2 as bigint) from t2)^在位运算中,只有一个 expression 可以是 binary 或 varbinary 数据类型。
insert into t3
select ( select l1 from t1) ^ (select cast(l2 as bigint) from t2)|insert into t3
select ( select l1 from t1) | (select cast(l2 as bigint) from t2)
我是把数据加密后存于数据库中,
设想是在用户请求时,由存储过程读出数据并解密,将解密后的数据返回给用户
其实问题很简单,在C中表述为
char buf[100] , key[10] , decode[100]
即是每次将buf中的10个字节和key执行^(异或)操作,并把结果存入decode中
不知道在SQL中这类问题如何解决?
另外,如果在服务器端反复执行此类操作会不会对性能影响很大?