即然存储过程里传参数,不能大于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

解决方案 »

  1.   

    '这个可以啊.$text="aaaaaaaaaaaaaa";
    $sql="execute report_write @report_id=39,@ptrval1=cast('" +.$text.+"' as varbinary(16))";
      

  2.   

    --楼主搞错了,存储过程可以传递text参数.CREATE PROCEDURE  report_write
    @report_id int,
    @@content text 
    AS 
    update report..content set content=@content where id=@report_id
    go--调用:
    exec report_write 1,'aaaaa'
      

  3.   

    可是我这里报这样的错误
    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
      

  4.   

    --上面的写错了一点:CREATE PROCEDURE report_write
    @report_id int,
    @content text 
    AS 
    update report..content set content=@content where id=@report_id
    go--调用:
    exec report_write 1,'aaaaa'
      

  5.   

    --下面是测试--创建测试的表
    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 行)
    --*/
      

  6.   

    在php中调用修改后的存储过程$sql="execute report_write @report_id=39,@ptrval1='aaaaaaaaaaaaaaa'";
      

  7.   

    这里用两个 @@  , @@content 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看我的代码应如何改: sql server 70
      

  8.   

    --当然没有问题.第一个@@是笔误.后面的才正确.你的应该改为:CREATE PROCEDURE report_write
    @report_id int,
    @content text 
    AS 
    update report..content set content=@content where id=@report_id
    go