How to:Transfer Table to Text?
-
Hi, I want to copy a Table (in sql server) to a specified Text File programmatically using DTS.Can any one help me?If possible can u please paste the code? Thanks in advance
-
Hi, I want to copy a Table (in sql server) to a specified Text File programmatically using DTS.Can any one help me?If possible can u please paste the code? Thanks in advance
You can do this one of three ways. 1.) The best way is to use an ADO Recordset / ADO.NET DataSet and use the "Save" / "WriteXML" Methods. This is best because both the Recordset and DataSet can open an XML file. 2.) Use BCP to Bulk Export data from the Table to a Text File. This is essentially what the DTS does. 3.) There is also a way to Bulk export using an XML format but I can't remember the command. Not all those who are lost are looking to be found. But of those who are lost and those who are found, all are looking for something higher than themselves.