XML : Insert data in to table using xml and storeprocedure in sql server 2008

I am trying to insert data in to table while doing this is I am getting an error like

cannot find column name or user define function "Tbl.Col.value" or aggregate Tbl.Col.value or the name is ambiguous

Following is my store procedure:

  ALTER PROCEDURE Ecal_InsertVerniercal_Sp @exml XML  AS  BEGIN        INSERT INTO Vernier_Gauge_Calibration (Comment, Report_Number, Acceptance_Status, Calibration_Date, Approved_By)        SELECT          Tbl.Col.value('@Reamrk', 'varchar(200)') AS Reamrk,          Tbl.Col.value('@ReportNo', 'nvarchar(255)') AS ReportNo,          Tbl.Col.value('@Status', 'varchar(MAX)') AS Status,          Tbl.Col.value('@CalDate', 'datetime') AS CalDate,          Tbl.Col.value('@CalBy', 'datetime') AS CalBy      FROM @exml.nodes('/CalibrationData/CalInfo') AS Tbl (Col)        RETURN;    END    GO    

No comments:

Post a Comment