473,520 Members | 3,216 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to export xml in dts "Excute SQL Task" to a flat file

6 New Member
Hi Guys,

I included "for xml auto" in sql statement in "Excute SQL Task" and aimed to dump the output to a flat file. I added "ActiveX Script Task" into my package and with the following lines:

dim strRecord
dim objFSO
dim objStream
dim objResults

const OUTPUT_FILE = "c:\XmlOutput.txt"
const fsoForWriting = 2

set objFSO = CreateObject("Scripting.FileSystemObject")
set objStream = objFSO.OpenTextFile(OUTPUT_FILE, fsoForWriting, true)
set objResults = DTSGlobalVariables("gResults").Value

Where "gResults" is my Rowset output parameter set as a global variable. If without "for xml auto" clause I could get my result something like:

strRecord = objResults.Fields(0).value & " " & objResults.Fields(1).value
objStream.WriteLine(strRecord)

in a loop to dump the result to my flat file. With "for xml auto" clause "objResults.Fields(0).value" is not working any more. Any suggestions what I am going to do in this situation?

Regards,
Aug 1 '06 #1
0 4410

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1364
by: Tom | last post by:
I've forgotten how to add a particular line to the task list in vs2003 before there was a context menu that you can click on to add something to task and come back to later.. but now I can't find it in the context menu.. the task list window is still there but how do we add to it ? thanks Tom
4
3711
by: Leeor Chernov | last post by:
Hi , I Used the object Excell Application(COM INTEROP) and it is staying as an open process, And the owner(User Name) is ASPNET Altough I try to release it with : System.Runtime.InteropServices.Marshal.ReleaseComObject, And GC.Collect. Every time I am opening a new Excel.Application() , I get more Processes in memory. Note: I am calling...
0
2645
by: SpockMonster | last post by:
Our solution contains multiple projects, such as: 1 Web project 3 library projects that contain Serviced Components 7 library projects that do not contain Servicded Components Long ago, a previous project member created a file chose to name "AssemblyCommonInfo.vb" in the SOlution root, and placed a link to this in every project (except the...
6
2728
by: Tony Wong | last post by:
I have a C++ project (assembly) and a C# project (client that uses the C++ assembly). These projects used to work when compiled under VS 2003 but when I upgraded my projects to VS 2005 I got the following error when I compile the C# client, ----------------------------------------------------------------------------...
0
4984
by: gelangov | last post by:
I have a table, that has a column which determines the file name. I want to export a file and rename it immediately. For Ex: Select Id, count(*) from Mytable group by ID gives the following:
4
13255
by: e-Ricc | last post by:
Hi guys! Im trying to detect when a user "kills" my c# app using windows task manager, i've tried with the form events _closing and _closed managing for example putting an if inside to detect it: if (e.CloseReason == CloseReason.TaskManagerClosing) { MessageBox.Show("from task manager"); }
0
1283
by: Rahul | last post by:
Hello, Is it possible (by code) to set a timer and "force" the computer to wake up from hibernation/standby/sleep mode (either at specific time... or after specific interval) through C# code? Please let me know about any possible solutions/ideas you may have. Thanks,
4
6173
by: AliRezaGoogle | last post by:
Dear Members I have a critical program written in c#. It runs every time the user log on. But sometimes log-oned user forces my application process to quit by “End Process” in task manager. How can I be notified whenever the process is killed by task manager? I want to keep my process always alive. At least after it is killed, I want it to...
1
1956
by: vikassawant | last post by:
hi, I am using external POI package to perform excel import and export task in my project.This package is present at C drive on my machine. When I execute this project at command prompt it works well but when I create JAR file of this project,it does not perform only the task which performed with the help of POI package. To create...
0
7324
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7464
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7627
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7588
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5155
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
1678
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
855
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
529
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.