I have 2 stored proc.
The first one receive as input parameter some variables and one of them is XML.
Inside this proc i call another proc but dynamically like that. This proc handle the XML to insert it in the DB.
SET @SQL = 'EXEC [' + @ServerIp + '].[List_' + CAST(@AccountId AS VARCHAR) + '].[dbo].[psu_proc_name] @ParameterId = ' + CAST(@ParameterId AS VARCHAR) + ',@MappingFields = ' + @MappingFields
@MappingFields is the name of the XML variable in the first proc and also in the second proc (called dynamically)
I manage the treatment of the XML in the second proc (dynamic) but i don't know how to pass the parameter as XML to the second proc.
Thanks