我在sql server 2005 enterprise的sql server profiler中监视得到这样一句话:
exec sp_execute 12,N'/Notifications.commandTable',1 
是什么意思呢?我的物理表中没有commandTable这个表啊。

解决方案 »

  1.   

    未发现有sp_execute.是自己编写的吧?
      

  2.   

    在EventClass中是“RPC:Starting”,后续还有“RPC:Completed”。
    估计是个rpc调用,但调用的函数是什么名字?咋调用的。?
      

  3.   

    是sp_executesql吧?
    执行可以多次重复使用或动态生成的 Transact-SQL 语句或批处理。Transact-SQL 语句或批处理可以包含嵌入参数。语法
     
    sp_executesql [ @stmt = ] stmt

        {, [@params=] N'@parameter_name data_type [ [ OUT [ PUT ][,...n]' } 
         {, [ @param1 = ] 'value1' [ ,...n ] }
    ]
     
    以下示例将创建并执行一个简单的 SELECT 语句,其中包含名为 @level 的嵌入参数。 复制代码 
    EXECUTE sp_executesql 
              N'SELECT * FROM AdventureWorks.HumanResources.Employee 
              WHERE ManagerID = @level',
              N'@level tinyint',
              @level = 109;
     
      

  4.   

    已经查过帮助,未发现有sp_execute,但是有sp_executesql.另:至于Notifications.commandTable表,要带用户Notifications来查询.select * from Notifications.commandTable而select * from commandTable是错的.
      

  5.   

    在google中搜索,发现是和调用rpc相关的东东:
    而且我抓获到的东西是exec sp_execute 12,N'/Notifications.commandTable',1 
    注意:Notifications.commandTable前面还有一个反斜杠“/”。
      

  6.   

    好像跟预编译有关,sp_prepexec、sp_excute、sp_unprepare这三个依次执行,不知道为什么帮助文档里面不提这几个函数,我也挺困惑,希望大家都交流一下
      

  7.   

    declare @p1 int
    set @p1=170
    exec sp_prepexec @p1 output,N'@P1 nvarchar(40),@P2 nvarchar(40),@P3 nvarchar(40),@P4 int,@P5 nvarchar(2),@P6 int,@P7 nvarchar(2),@P8 nvarchar(2),@P9 int,@P10 nvarchar(2),@P11 
    nvarchar(2),@P12 int,@P13 nvarchar(2),@P14 nvarchar(2)',N'Insert into 
    [dbo].[CPRF]([FormID],[ItemID],[ColID],[Width],[VisInForm],[VisualIndx],[EditInForm],[VisInExpnd],[ExpandIndx],[EditInEXP],[Folded],[UserSign],[ExtDisable],[ExtInvsbl]) values( @P1, @P2, 
    @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14)',N'139',N'130000331',N'U_03',64,N'Y',3,N'Y',N'Y',3,N'Y',N'N',1,N'N',N'N'
    select @p1
    定义了一个170,好像是句柄,然后
    exec sp_execute 170,N'139',N'77',N'9',97,N'Y',10,N'N',N'Y',14,N'N',N'N',1,N'N',N'N'
    添加参数最后
    exec sp_unprepare 170
    执行这个所谓的句柄这是我跟踪出来的,具体怎么用我还真说不清楚