I simplified the offending procedure to be just a series of Declare and Set statements. Start the debugger, then turn on the local watches window. Now just F8 through each statement and it’ll eventually throw the error. Multiple developers here have confirmed it, so it’s not just me.
/****** Object: STOREDPROC [sp_debug_test] - Script Date: 8/30/2013 8:24:40 AM ******/
create procedure sp_debug_test( )
begin
declare xml_element exception for sqlstate value ‘99001’;
declare no_bills_to_process exception for sqlstate value ‘99004’;
declare no_output_file_path exception for sqlstate value ‘99005’;
declare @xml_temp xml;
declare @repricestack xml;
declare @xml_header xml;
declare @xml_trailer xml;
declare @xml_stack_open xml;
declare @xml_stack_close xml;
declare @errormessage long varchar;
declare @errorcode integer;
declare @sqlstate varchar(32767);
declare @bills_count integer;
declare @outfilepath long varchar;
declare @outfilename long varchar;
declare @fulloutfilename long varchar;
set @xml_header
= '<soap:Envelope xmlns:xsi="www.w3.org/…/XMLSchema-instance" xmlns:xsd="www.w3.org/…/XMLSchema" xmlns:soap="schemas.xmlsoap.org/.../">soap:Body<RepriceStack xmlns="secure.medrisk.net/…/">&
set @xml_trailer = ‘</soap:Body></soap:Envelope>’;
–*******************************************
– Document header and element
–*******************************************
set @repricestack = @xml_header;
–*******************************************
– element
–*******************************************
set @xml_stack_open = ‘’;
set @xml_stack_close = ‘’;
set @xml_temp = XMLELEMENT(‘testmode’,‘true’);
set @xml_temp = @xml_temp || XMLELEMENT(‘clientid’,‘1111’);
set @xml_temp = @xml_temp || XMLELEMENT(‘siteid’,‘2222’);
set @xml_temp = @xml_temp || XMLELEMENT(‘subclientid’,’’);
set @xml_temp = @xml_temp || XMLELEMENT(‘clientpassword’,‘xyzzy’);
set @xml_temp = @xml_temp || XMLELEMENT(‘resultcode’,0);
set @xml_temp = @xml_temp || XMLELEMENT(‘ignoreexhibits’,‘false’);
set @xml_temp = @xml_temp || XMLELEMENT(‘allowpendedbills’,‘false’);
set @repricestack = @repricestack || @xml_stack_open || @xml_temp;
– Output filename: MITCHELLSBI_yyyymmdd_hhnnss.XML
set @outfilename = ‘MITCHELLSBI_’ || convert(varchar, today(), 112) || ‘_’ || left(replace(convert(varchar, getdate(), 114), ‘:’, ‘’),6) || ‘.XML’;
set @fulloutfilename = @outfilepath || @outfilename;
end
GO