即然存储过程里传参数,不能大于8000 ,那么看一下对于 write text 哪何处理
CREATE PROCEDURE report_write @report_id int,@ptrval1 varbinary(16)
AS
declare @ptrval varbinary(16)
SELECT @ptrval = TEXTPTR(content) from report where id=@report_id
writetext report.content @ptrval @ptrval1
go
CREATE PROCEDURE report_write @report_id int,@ptrval1 varbinary(16)
AS
declare @ptrval varbinary(16)
SELECT @ptrval = TEXTPTR(content) from report where id=@report_id
writetext report.content @ptrval @ptrval1
go
$sql="execute report_write @report_id=39,@ptrval1=cast('" +.$text.+"' as varbinary(16))";
@report_id int,
@@content text
AS
update report..content set content=@content where id=@report_id
go--调用:
exec report_write 1,'aaaaa'
Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'aaaaaaaaaaaaaa'., SQL state 37000 in SQLExecDirect in d:\zh\www\www\test.php on lin
@report_id int,
@content text
AS
update report..content set content=@content where id=@report_id
go--调用:
exec report_write 1,'aaaaa'
create table content(id int identity(1,1),content text)
go--初始化数据
insert into content values(null)
go--创建处理的存储过程
CREATE PROCEDURE report_write
@report_id int,
@content text
AS
update content set content=@content where id=@report_id
go--调用:
exec report_write 1,'aaaaa'
go--显示结果
select * from content
go--删除测试
drop table content
drop proc report_write/*--测试结果
id content
----------- -----------
1 aaaaa(所影响的行数为 1 行)
--*/
AS
declare @ptrval varbinary(16)
SELECT @ptrval = TEXTPTR(content) from report where id=@report_id
writetext report.content @ptrval @ptrval1
go看我的代码应如何改: sql server 70
@report_id int,
@content text
AS
update report..content set content=@content where id=@report_id
go