haitao:
BINARY_CHECKSUM的输入好像不受限制。。。
[阅读: 565] 2007-03-28 09:25:29
测试代码:
declare @myTable TABLE(column1 int, column2 nvarchar(max))
INSERT INTO @myTable VALUES (1, 'test');
INSERT INTO @myTable VALUES (2, 't1est');
INSERT INTO @myTable VALUES (3, 'te2st');
INSERT INTO @myTable VALUES (4, 'tes3t');
SELECT BINARY_CHECKSUM(column2) from @myTable;
DECLARE @HashThis nvarchar(max), @i int;
SELECT @HashThis = CONVERT(nvarchar,'dslfdkjLK85kldhnv$n000#knf');
set @i=1
while @i<10
begin
set @hashthis=@hashthis+'1'+@hashthis
set @i=@i+1
end
UPDATE @myTable set column2 =
@hashthis
--'TEST'
where column1=2
SELECT BINARY_CHECKSUM(column2) from @myTable;