CREATE PROCEDURE [dbo].[stproc_ssb_send] (@iname varchar(20))
WITH EXECUTE AS 'xyz'
AS
BEGIN
DECLARE @DIALOG_HANDLE UNIQUEIDENTIFIER
DECLARE @MSG varchar(max)
SET @MSG='<MESSAGE>
<test>' + @iname + '</test>
</MESSAGE>'
BEGIN DIALOG CONVERSATION @DIALOG_HANDLE
FROM SERVICE START_PROC_PROCESS_SERVICE
TO SERVICE 'EXECUTE_PROC_PROCESS_SERVICE'
ON CONTRACT [PROC_PROCESS_CONTRACT]
WITH ENCRYPTION= OFF;
SEND ON CONVERSATION @DIALOG_HANDLE
MESSAGE TYPE PROC_PROCESS_MT(@MSG);
END CONVERSATION @DIALOG_HANDLE
END
错误:
消息15517,级别16,状态1,过程[stproc_ssb_send],第0行 无法作为数据库主体执行,因为主体&#34; xyz&#34; 不存在,这种类型的委托人不能被冒充,或者你 没有许可。
XYZ是此数据库的db_owner / db_ddladmin。