dbTalk Databases Forums  

DTS - Autorun from Text file

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


Discuss DTS - Autorun from Text file in the microsoft.public.sqlserver.dts forum.



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

Default DTS - Autorun from Text file - 02-11-2004 , 06:42 PM






Here's what I am looking at. I have a text file, tab delimited, that I need
to bring into a SQL Server 2000 table.

For the sake of arguement, the file will be like:

Number,Code,Notes

I need it to search the table, find the matching number and Code, then
append the notes. The caveat is that the final product, (SQL Side) cannot
exceed 1000 characters, so I need to make sure that the COMBINED Notes entry
does exceed 1000, if so, make it an exception for a report then move on to
the next item.

What's the best way to do this, as with VB I can think of several ways, but
doing it all in SQL Server is making me draw a blank. Any help will be
greatly appreciated.



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

Default Re: DTS - Autorun from Text file - 02-12-2004 , 01:23 AM






I would

Import the Text file into a working table
Match with the real table on Key vals

Do an UPDATE on the real table where the combined LEN() of the working table
notes field and the real table notes field < 1000.
Insert the other key values into a table of Exceptions.



--

----------------------------

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


"Acral" <Notme (AT) ever (DOT) com> wrote

Quote:
Here's what I am looking at. I have a text file, tab delimited, that I
need
to bring into a SQL Server 2000 table.

For the sake of arguement, the file will be like:

Number,Code,Notes

I need it to search the table, find the matching number and Code, then
append the notes. The caveat is that the final product, (SQL Side) cannot
exceed 1000 characters, so I need to make sure that the COMBINED Notes
entry
does exceed 1000, if so, make it an exception for a report then move on to
the next item.

What's the best way to do this, as with VB I can think of several ways,
but
doing it all in SQL Server is making me draw a blank. Any help will be
greatly appreciated.





Reply With Quote
  #3  
Old   
Noah Ganter
 
Posts: n/a

Default Re: DTS - Autorun from Text file - 02-12-2004 , 07:27 AM



I'll add that DTS or a simple import of a text file is probably over kill -
use BCP
-noah


"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
I would

Import the Text file into a working table
Match with the real table on Key vals

Do an UPDATE on the real table where the combined LEN() of the working
table
notes field and the real table notes field < 1000.
Insert the other key values into a table of Exceptions.



--

----------------------------

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


"Acral" <Notme (AT) ever (DOT) com> wrote in message
news:102livrh4p8uucf (AT) corp (DOT) supernews.com...
Here's what I am looking at. I have a text file, tab delimited, that I
need
to bring into a SQL Server 2000 table.

For the sake of arguement, the file will be like:

Number,Code,Notes

I need it to search the table, find the matching number and Code, then
append the notes. The caveat is that the final product, (SQL Side)
cannot
exceed 1000 characters, so I need to make sure that the COMBINED Notes
entry
does exceed 1000, if so, make it an exception for a report then move on
to
the next item.

What's the best way to do this, as with VB I can think of several ways,
but
doing it all in SQL Server is making me draw a blank. Any help will be
greatly appreciated.







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.