![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all, Im a bit rusty on DTS after working mostly on .Net and other Server products for the past two years I have a large amount of data to load (millons of rows from a mainframe) and have picked the Data Pump task and possibly the Dynamic Properties task or Execute SQL task --problem is I cant find a good dts sample to get me started on a robust best practises Flatfile Load. I have 39 Flatfiles to load into SQL Server 2000 SP3A that contain the same schema and need to know how to dymanicly set the connection properties of the source connection (text) Source FlatFileName = d:\ftproot\BLDTSE01 Source FlatFileName = d:\ftproot\BLDTSE02 ....etc etc........... Source FlatFileName = d:\ftproot\BLDTSE39 Q1: How do I dymanicly set the connection properties of the source connection (text) so I can use the one DTS package for this |
|
Q2: The last two characters of the flat File Name tell me the Cycle, (possible range 1 to 39) 'SQL Server destination CREATE TABLE [S_BLDTSE] ( [DTLMEI] [int] NOT NULL , [DTLMLN] [int] NOT NULL , [DTLRSN] [int] NOT NULL , [DTLIDS] [varchar] (25) COLLATE Latin1_General_CI_AS NOT NULL , [CYCLE] [tinyint] NULL --extra column not in source ) ON [PRIMARY] GO example: Source FlatFileName = d:\ftproot\BLDTSE39--we can calulate the value for the extra column "cycle" in our destination table In this case the last two chars of the FlatFileName are 39 which equals CYCLE 39, what is the quickest way to insert the CYCLE value during the load? |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Thanks Darran, Expanding on what I want to do is Truncate the SQL server staging tableand after I have finished the flat file load then append the data in the stage to a monthly holding table which mirrors the stage schema but with an autogenerated ID ie Stage table TRUNCATE TABLE TABLE S_BLDTSE-->Then load Flat file CREATE TABLE [S_BLDTSE] ( [DTLMEI] [int] NOT NULL , [DTLMLN] [int] NOT NULL , [DTLRSN] [int] NOT NULL , [DTLIDS] [varchar] (25) COLLATE Latin1_General_CI_AS NOT NULL , [CYCLE] [tinyint] NULL --extra column not in source ) ON [PRIMARY] GO 'SQL Server destination monthly holding CREATE TABLE [BLDTSE] ( ID--Autogenerated on insertextra column not in source [DTLMEI] [int] NOT NULL , [DTLMLN] [int] NOT NULL , [DTLRSN] [int] NOT NULL , [DTLIDS] [varchar] (25) COLLATE Latin1_General_CI_AS NOT NULL , [CYCLE] [tinyint] NULL --holds all billing cycles for the month ie 1-39 ) ON [PRIMARY] GO techique 1: Im not quite sure of exactly how to set up the active X task correctly in the data pump?I assume I will be doing a row by row transform this way. I may have 1-10 million records in some files with low cycle numbers and trailing off to a few hunfred thousand as we near cycle 39 at month end Open the DataPump task and select the Transforms tab. Click the Cycle |
|
techique 2 Assuming I update the global as I read each filename via Active X,how do I send that to the Execute SQL task |
|
Would it be possible to see a quick DTS sample of each of the two techiques you described. |
![]() |
| Thread Tools | |
| Display Modes | |
| |