Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 9th, 2003, 04:45 AM
jimbob772 jimbob772 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 jimbob772 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation Sql Server Dts

Hi,
Have a problem importing a text file into a sql server db.

Basically i need to code a dts that will use an active x script when importing one column of the of the text file. If this column has a input of 1 or 3 then the next column should be input into the next field in the db. If this column has an input of 2 then i need to insert the next column by skipping the next field in the db. Any ideas?

Reply With Quote
  #2  
Old July 9th, 2003, 04:51 AM
pabloj's Avatar
pabloj pabloj is online now
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,707 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 2 h 40 m 40 sec
Reputation Power: 259
Isn't it simpler (and faster) to load everything in the db with a basic DTS and then use TSQL to accomplish the select/insert?

Reply With Quote
  #3  
Old July 9th, 2003, 05:05 AM
jimbob772 jimbob772 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 jimbob772 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unfourtunetly the data has to be entered into certain fields upon importing the text file as it will be automated...here is the active x script in sql

'**********************************************************************
' Visual Basic Transformation Script
'************************************************************************

' Copy each source column to the destination column
Function Main()
DTSDestination("TypeFlag") = DTSSource("Col002")
Main = DTSTransformStat_OK
End Function

basically if DTSSource("Col002") - 1 or 3 the next text column should be entered into the next db field (say the 3rd field)....if DTSSource("Col002") = 2 then the next column should be entered into the 4the db field skipping the 3rd one!!confused??i am!!!

thanks for your reply!

Reply With Quote
  #4  
Old July 9th, 2003, 05:28 AM
pabloj's Avatar
pabloj pabloj is online now
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,707 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 2 h 40 m 40 sec
Reputation Power: 259
I got your point, mine was that it's easier (and faster AFAIK) to load the file unchanged in a "service" table and then build a TSQL procedure to extract data.
This can be easily automated and scheduled.

Reply With Quote
  #5  
Old July 9th, 2003, 05:33 AM
jimbob772 jimbob772 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 jimbob772 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
dts

yeah i know what you mean tragically i have to doo it this way!!any ideas??

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Sql Server Dts


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway