|
-
Jul 6th, 2017, 05:40 AM
#1
Thread Starter
New Member
Why Data Isn't being Inserted By XML into Table in the SQL server Database
Hey !!! why data isnt being inserted into Table in the SQL server ..when vb.net code works fine.. here is structure of stored procedure which i have created to inserted data through my vb.net application. I am passing XML data from vb.net application using sqlparamerters.
CREATE PROCEDURE [dbo].[upproductdetails]
@dttest XML
AS
BEGIN
SET NOCOUNT ON
SET XACt_Abort ON
BEGIN TRANSACTION
Begin
Insert into [productdetails](Product_Id, Product_Name, product_Price)
SELECT
D.dttest.value('./Product_Id[1]','nvarchar(15)') AS Product_Id,
D.dttest.value('./Product_Name[1]','nvarchar(15)') AS Product_Name,
D.dttest.value('./product_Price[1]','nvarchar(15)') AS product_Price
FROM @dttest.nodes('/DocumentElement/dttest') AS D(dttest)
END
SET XACt_Abort OFF
COMMIT TRANSACTION
END
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|