dbTalk Databases Forums  

Testing field names before import

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


Discuss Testing field names before import in the microsoft.public.sqlserver.dts forum.



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

Default Testing field names before import - 03-05-2004 , 01:24 PM






I have an import text file whose definition might vary.

Is it possible to create an ActiveX script task that will check the field
names in the text file before importing to ensure they are the same as the
destination table field names?

For example, the script should test to see if the 3rd field in the text file
is named "city" before importing the field contents into the "city" field of
the destination table.



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

Default Re: Testing field names before import - 03-06-2004 , 06:17 PM






You will have to write your own validation/scrubbing program. You would
read line#1 of the text file and count the delimiters so you knew when you
were at col 3. You can then test the value there.

You could easily do this in an Active Script task.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Dave" <dave (AT) nodomain (DOT) tv> wrote

Quote:
I have an import text file whose definition might vary.

Is it possible to create an ActiveX script task that will check the field
names in the text file before importing to ensure they are the same as the
destination table field names?

For example, the script should test to see if the 3rd field in the text
file
is named "city" before importing the field contents into the "city" field
of
the destination table.





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.