title: Implicit conversion from data type xml to nvarchar is not allowed. Use the CONVERT function to run this query
body: <p>I'm writing following SQL procedure:</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[spc_InsertSubjectToContentRelation]
  (
      @pCourseGUID XML, 
      @pSubjectId XML,
      @pAssessmentIds XML,
      @pVideoIds XML
  )
  AS
  BEGIN
  SET NOCOUNT ON;
  
      DECLARE @CourseGUID NVARCHAR(50);
      DECLARE @SubjectId NVARCHAR(50);
      DECLARE @AssessmentIds NVARCHAR(MAX);
      DECLARE @VideoIds NVARCHAR(MAX);
  
      SET @CourseGUID = Convert(NVARCHAR,@pCourseGUID);
      SET @SubjectId = Convert(NVARCHAR,@pSubjectId);
      SET @AssessmentIds = Convert(NVARCHAR,@pAssessmentIds);
      SET @VideoIds = Convert(NVARCHAR,@pVideoIds);
  
      INSERT INTO SubjectToAssessmentAndVideoRelation VALUES (@pCourseGUID, @pAssessmentIds, @pAssessmentIds, @pVideoIds)
  END
  </code></pre>
  
  <p>When I'm running this procedure I'm getting the error:</p>
  
  <blockquote>
    <p>Implicit conversion from data type xml to nvarchar is not allowed. Use the CONVERT function to run this query.
    How can I resolve this?</p>
  </blockquote>