- 论坛徽章:
- 7
|
最近在使用RPC的时候发现这么一个问题——
两个ASE Server A,B,两边的rpc配置均已完毕,并且测试成功。
先在A上建这样一个过程——
- create procedure p_prtest
- @remote varchar(30),
- @db varchar(30),
- @tb varchar(50)
- as
- begin
- declare @cmdstr varchar(500)
- select @cmdstr='create proxy_table pr_tmp at "'+@remote+'.'+@db+'..'+@tb+'"'
- select @cmdstr
- execute(@cmdstr)--proxy table creation part
-
- select @cmdstr='select * from pr_tmp'
- execute(@cmdstr)--test part
-
- select @cmdstr='drop table pr_tmp'
- execute(@cmdstr)
- end
- go
复制代码 在A上执行 exec p_prtest "B","db","tb1"完全正确,可以看到那个生成代理表的语句为—— create proxy_table pr_tmp at "B.db..tb1"
但是到了B或者任何其它Server上用RPC调用的时候,例如在B上执行 exec A.db..p_prtest "B","db","tb1"就要报错说——
Msg 11204, Level 16, State 23:
Server 'A', Line 1:
There is an error in the syntax of the object definition '"B.db..tb1"'.
但是可以看到被执行的那句动态sql同样也是——create proxy_table pr_tmp at "B.db..tb1"
弟兄们可否知道这是怎么回事?谢谢。 |
|