ok, try this:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[pr_DataSave]
(
@Xml XML
)
AS
SET NOCOUNT ON
CREATE TABLE #tblXmlData
(
Id INT IDENTITY(1,1) NOT NULL,
ColumnName VARCHAR(80),
ColumnValue VARCHAR(500),
ColStatus VARCHAR(1) DEFAULT 0
)
DECLARE @Index INT
DECLARE @Sql VARCHAR(5000)
DECLARE @Values VARCHAR(5000)
DECLARE @ColName VARCHAR(50)
DECLARE @ColValue VARCHAR(500)
DECLARE @x nvarchar(max)
DECLARE @Path NVarchar(500)
SET @x = N'
SELECT
[ColumnName] = ParamValues.Col.value(''ColumnName[1]'',''VARCHAR(50)''),
[ColumnValue] = ParamValues.Col.value(''ColumnValue[1]'',''VARCHAR(500)'')
FROM @Xml.nodes(''' + @Path + ''' ) as ParamValues(Col)'
INSERT INTO #tblXmlData(ColumnName, ColumnValue)
exec sp_executesql @x, N'@Xml XML', @Xml
GO