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.
| Author |
Topic |
|
BlazingMavrick
Starting Member
1 Post |
Posted - 2008-03-17 : 14:56:01
|
| Hi, i wondered if anyone could help me with my stored procedure.It updates a table with users messageboard and saves the Title, Line 1, Line 2 and so on into a XML thats stored in the column named XML_Data.How can i then output this xml to a file on my local machine? T-SQL :-ALTER PROCEDURE [dbo].[prUpdateMessageBoardVetted](PARAMS GO HERE)UPDATE CustomerData SET Title = @Title, Line1 = @Line1, Line2 = @Line2, Line3 = @Line3, Line4 = @Line4, Line5 = @Line5, Line6 = @Line6, XmlFileName = @XmlFileName, FlashFileName = @FlashFileName, HtmlFileName = @HtmlFileName, Vetted = @Vetted, ClientName = @ClientName WHERE (UserRef = @original_UserRef)ENDBEGINIF @Vetted = 1DECLARE @xmlData AS XMLSET @xmlData = (SELECT UserRef,Title,Line1,Line2,Line3,Line4,Line5,Line6FROM dbo.CustomerData WHERE (UserRef = @original_UserRef) FOR XML RAW('Message'), ELEMENTS)SELECT @xmlData UPDATE [dbo].[CustomerData] SET XML_Data = @xmlData WHERE(UserRef = @original_UserRef) (THEN HERE DO SOME SORT PROCEDURE TO OUTPUT @xmlData to a XML FILE ON MY LOCAL MACHINE, BUT ALSO NAME THE XML FILE VIA @XmlFileName BY DOING SOME SORT OF CONCANTENATION)any ideas?Thanks in advance ! Neil |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-03-17 : 17:11:52
|
| use bcp_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
|
|
|
|
|