Hi, thanks for your reply. I think I have it done.
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[sp_ImpPrescriptions]
@XML xml
as
insert into ImpHist(MsgID,MsgIssueDate)
SELECT
T.Msg.query('MsgId').value('.', 'uniqueidentifier'),
T.Msg.query('MsgIssueDate').value('.', 'varchar(20)')
FROM @xml.nodes('EtpPrescribe') AS T(Msg)
insert into prescriptions
SELECT
T1.Prescription.query('Guid').value('.',...