dbTalk Databases Forums  

create and execute a dts package using asp - fails with varying no of columns in file

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


Discuss create and execute a dts package using asp - fails with varying no of columns in file in the microsoft.public.sqlserver.dts forum.



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

Default create and execute a dts package using asp - fails with varying no of columns in file - 07-12-2004 , 11:37 AM






Hi,

After a lot of research and online help and also using the DTS wizard
option in the Enterprise Manager, I was able to develop a program in
asp that creates a DTS package
starting from setting up the connections, the tasks and the final
execute to import data
from a text file to a table.

I started of by doing a creating a sample DTS package using the DTS
wizard in enterprise manager and saved the source code as vb file and
then modified the vb code to asp code.

Everything works but I have some problems when I try to add more
custom options on the package being created.

For example, int the sample dts i created the file had 4 columns. Now
if I change the file and the file contains more or less columns, then
the package fails. I am sure there is a property in one of the DTS
objects where we can specify the no of columns.

I tried changing the following property:

oTransformation.TransformPhases = no of columns

but the package still fails.

I even tried duplicatiing the dts package again using the DTS wizard
in the enterprise manager and I found that the value for the above
said property changes according to the no of columns you have in your
file.

Even if I hard code the no of columns value for another file in my
source code, it still fails. So my code only works for the same no of
columns I created the sample DTS with.

Can anybody point me to the property specification or even a book
which specifies the different proeprties and values for the various
DTS objects available on sql 2000.

I tried going through the sql books online, they give only a vague
reference. I can't seem to land the right reference help.

If anybody can point me to the right reference or even recommend a
book that has the information, please let me know.

Thank you for your help.

Yasir

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

Default Re: create and execute a dts package using asp - fails with varying no of columns in file - 07-12-2004 , 12:06 PM






It is because the metadata has changed. You cannot simply add/remove
attributes from the Source and Destination like this unfortunately.


Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
www.konesans.com - for all your consultancy needs




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.