我正在创建一个存储过程,但在执行该过程时,我收到了特定的错误.
消息217,级别16,状态1,过程SendMail_Renewapp,第77行超出最大存储过程,函数,触发器或视图嵌套级别(限制32).
任何人都可以帮我解决这个问题.
我的程序如下..
`ALTER PROCEDURE [dbo].[SendMail_Renewapp]
-- Add the parameters for the stored procedure here
AS
BEGIN
declare @xml nvarchar(max)
declare @body nvarchar(max)
declare @currentdate datetime;
declare @ExpDate datetime;
declare @mailsendingdate datetime;
declare @renewtime varchar(10);
DECLARE @AgencyId int;
DECLARE @ApplicationID int;
declare @emailid varchar(100);
set @currentdate=getdate();
--Fetching the application details: start--
DECLARE AppCursor CURSOR FOR
Select top 5 applications.ap_id,applications.ap_expiry_date,agency.ag_co_email from applications join agency on applications.ap_agency_id=agency.ag_id
where ap_status='AS' and ap_iame_flag='IA' and ap_expiry_date != ''
OPEN AppCursor
FETCH NEXT FROM AppCursor …Run Code Online (Sandbox Code Playgroud)