dbTalk Databases Forums  

destination file with three different rows with different number of column and column size

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss destination file with three different rows with different number of column and column size in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dipa
 
Posts: n/a

Default destination file with three different rows with different number of column and column size - 07-14-2006 , 04:50 AM






I have three Stored Procedures in DTS, in which first stored procedure
is writing header row in destination file with four column.
Second procedure writing data into the destination file with 15 columns
Third stored procedure writing trailor row in data file with 4 column.

problem is if i map the resultant column of first stored procedure with
destination file and then map resultant column of second stored
procedure with destination file previous mapping is overwritten.


is there any way by which i can have three different rows with
different number of columns in each row and different sizes of columns.


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: destination file with three different rows with different number of column and column size - 07-15-2006 , 04:42 AM






Hello Dipa,


Here's an idea


Throw them into 3 seperate flat files and then use the DOS COPY command to
add them together in a seperate file.


Allan


Quote:
I have three Stored Procedures in DTS, in which first stored procedure
is writing header row in destination file with four column.
Second procedure writing data into the destination file with 15
columns
Third stored procedure writing trailor row in data file with 4 column.
problem is if i map the resultant column of first stored procedure
with destination file and then map resultant column of second stored
procedure with destination file previous mapping is overwritten.

is there any way by which i can have three different rows with
different number of columns in each row and different sizes of
columns.




Reply With Quote
  #3  
Old   
Dipa
 
Posts: n/a

Default Re: destination file with three different rows with different number of column and column size - 07-16-2006 , 11:56 PM



Hi,
Thanks a lot for replying.
Can you tell me in detail how can I do it DTS? Actually I dont know
much about DTS and DOS COPY command?

Thank you
Dipali


Allan Mitchell wrote:

Quote:
Hello Dipa,


Here's an idea


Throw them into 3 seperate flat files and then use the DOS COPY command to
add them together in a seperate file.


Allan


I have three Stored Procedures in DTS, in which first stored procedure
is writing header row in destination file with four column.
Second procedure writing data into the destination file with 15
columns
Third stored procedure writing trailor row in data file with 4 column.
problem is if i map the resultant column of first stored procedure
with destination file and then map resultant column of second stored
procedure with destination file previous mapping is overwritten.

is there any way by which i can have three different rows with
different number of columns in each row and different sizes of
columns.



Reply With Quote
  #4  
Old   
Dipa
 
Posts: n/a

Default Re: destination file with three different rows with different number of column and column size - 07-16-2006 , 11:56 PM



Hi,
Thanks a lot for replying.
Can you tell me in detail how can I do it DTS? Actually I dont know
much about DTS and DOS COPY command?

Thank you
Dipali


Allan Mitchell wrote:

Quote:
Hello Dipa,


Here's an idea


Throw them into 3 seperate flat files and then use the DOS COPY command to
add them together in a seperate file.


Allan


I have three Stored Procedures in DTS, in which first stored procedure
is writing header row in destination file with four column.
Second procedure writing data into the destination file with 15
columns
Third stored procedure writing trailor row in data file with 4 column.
problem is if i map the resultant column of first stored procedure
with destination file and then map resultant column of second stored
procedure with destination file previous mapping is overwritten.

is there any way by which i can have three different rows with
different number of columns in each row and different sizes of
columns.



Reply With Quote
  #5  
Old   
Dipa
 
Posts: n/a

Default Re: destination file with three different rows with different number of column and column size - 07-17-2006 , 12:08 AM



Hi,
Thanks a lot for replying.
Can you tell me in detail how can I do it DTS? Actually I dont know
much about DTS and DOS COPY command?

Thank you
Dipali


Allan Mitchell wrote:

Quote:
Hello Dipa,


Here's an idea


Throw them into 3 seperate flat files and then use the DOS COPY command to
add them together in a seperate file.


Allan


I have three Stored Procedures in DTS, in which first stored procedure
is writing header row in destination file with four column.
Second procedure writing data into the destination file with 15
columns
Third stored procedure writing trailor row in data file with 4 column.
problem is if i map the resultant column of first stored procedure
with destination file and then map resultant column of second stored
procedure with destination file previous mapping is overwritten.

is there any way by which i can have three different rows with
different number of columns in each row and different sizes of
columns.



Reply With Quote
  #6  
Old   
Frans van Bree
 
Posts: n/a

Default Re: destination file with three different rows with different numb - 07-17-2006 , 04:23 AM



In a Exceute SQL task:

DECLARE @CmdStr nvarchar(1000)
SET @CmdStr = 'copy file1.txt + file2.txt + file3.txt concatfile.txt'
EXEC master..xp_cmdshell @CmdStr

Reply With Quote
  #7  
Old   
Dipa
 
Posts: n/a

Default Re: destination file with three different rows with different numb - 07-19-2006 , 04:01 AM



hi,
Thanks for your reply.
I tried doing cancatenating three file but they(people in my project)
dont want me to do it in that way i.e.( they dont want to split up the
result in to three destination file and then concatenate.)

can anybody tell me some other solution for this .
Please help me in this.

Thanks and regards
Dipali Dagliya



Frans van Bree wrote:

Quote:
In a Exceute SQL task:

DECLARE @CmdStr nvarchar(1000)
SET @CmdStr = 'copy file1.txt + file2.txt + file3.txt concatfile.txt'
EXEC master..xp_cmdshell @CmdStr


Reply With Quote
  #8  
Old   
Frans van Bree
 
Posts: n/a

Default Re: destination file with three different rows with different numb - 07-19-2006 , 04:22 AM



You could try using a ActiveX script that
- connects to your database
- in some way captures the resultset of your stored procedures
- creates a filesystemobject
- spools all three resultsets to 1 textfile on disk using the filesystemobject

Reply With Quote
  #9  
Old   
Dipa
 
Posts: n/a

Default Re: destination file with three different rows with different numb - 07-19-2006 , 05:21 AM



Hi,

thanks .

Could you please explain me in detail? i dont know much about Active X
scipt.
What is filesystemobject? How to create it ?
can I take connection object and transformation task to execute stored
procedure from DTS tools.


Regards,
Dipali

Frans van Bree wrote:

Quote:
You could try using a ActiveX script that
- connects to your database
- in some way captures the resultset of your stored procedures
- creates a filesystemobject
- spools all three resultsets to 1 textfile on disk using the filesystemobject


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.