Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Write an xml file with a stored procedure RESOLVED

Author  Topic 

Pinto
Aged Yak Warrior

590 Posts

Posted - 2006-09-22 : 06:15:24
Can you, and if yes, how do you, write an xml file using a stored procedure. For example the sp below writes this new record to a sql table. How would I change it to write it to an xml file ?

CREATE Procedure [spOB_AddtblOB_Properties]

@strPropertyRef varchar (100),
@strRouteNo numeric,
@strAdd1 nvarchar(1000),
@strPostcode nvarchar(10)

as

Insert into tblOB_Properties (
PR_PropertyRef,
PR_RouteNo,
PR_Add1,
PR_Postcode)

values(
@strPropertyRef,
@strRouteNo,
@strAdd1,
@strPostcode)
GO

Pinto
Aged Yak Warrior

590 Posts

Posted - 2006-09-22 : 06:39:11
Sorted
Fill your dataset then

Dim src_path As String = "C:\XMLTesting\myFile.xml"

DsOBags1.WriteXml(src_path)
Go to Top of Page
   

- Advertisement -