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
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 txt to xml

Author  Topic 

nord
Posting Yak Master

126 Posts

Posted - 2013-09-12 : 11:49:11
Hi,
I would like convert txt file to xml file,I received flat file from ssis and would like convert to xml ,anu idea?
Thanks

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-09-12 : 12:56:40
quote:
Originally posted by nord

Hi,
I would like convert txt file to xml file,I received flat file from ssis and would like convert to xml ,anu idea?
Thanks

If you just have a text file on the OS, you probably should write a C# (or Java or some other langauge) program to do the conversion.

Or has the file been imported into a SQL Server? If it has, post details about the table(s) and some sample data.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-09-12 : 15:47:49
quote:
Originally posted by nord

Hi,
I would like convert txt file to xml file,I received flat file from ssis and would like convert to xml ,anu idea?
Thanks


you can BULK INSERT txt data to sql table and then use t-sql FOR XML syntax to convert data to xml.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

nord
Posting Yak Master

126 Posts

Posted - 2013-09-12 : 15:54:36
Thanks!
Go to Top of Page
   

- Advertisement -