zacard 2008-6-5 10:25
能不能做到支持变量的SQL导入呢(可加钱)
DECLARE @val nvarchar(100)
SET @val = CHAR(13)+CHAR(10)+'aaaa'
DECLARE @ptr binary(16)
declare @n int
select @n=open from tableA where id='1'
if(@n=0)
begin
update tableA set address='aaaa',open=1 where id='1'
end
else
begin
select @ptr=textptr(address) from tableA where id='1'
UPDATETEXT tableA.address @ptr null 0 @val
end
zacard 2008-6-5 14:18
DECLARE @ptr binary(16)
if((select open from tableA where id='5928')=0)
update tableA set address='aaaa',mo_open=1 where id='5928'
else
select @ptr=textptr(address) from tableA where id='5928'
UPDATETEXT tableA.address @ptr null 0 'aaaa'
现在我简化到这样,但还是提示有错!~~~
出现错误 tableA表1-错误信息:-1