dbTalk Databases Forums  

Import data with a package variable to SQL destination

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


Discuss Import data with a package variable to SQL destination in the microsoft.public.sqlserver.dts forum.



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

Default Import data with a package variable to SQL destination - 12-13-2006 , 05:49 AM






Hi there,

Using SQL Server 2005 SP1. I need to import a bunch of csv files into one sql server table using SQL Server
Integration Services. Each csv file contains price data for a financial market. The SQL Server table
definition is:

CREATE TABLE [dbo].[dt5min](
[market] [char](2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Date] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Time] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Open] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[High] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Low] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Close] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
CONSTRAINT [PK_dt5min] PRIMARY KEY CLUSTERED
(
[market] ASC,
[Date] ASC,
[Time] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

The csv file headings are Date, Time, Open, High, Low, Close but no market code. As each file is a different
market, what I want to do is create a variable and set the variable to the market code for each import that I
do. So I need to map the market code variable to the market destination column.

I have created a Data Flow task with a flat file source pointing to the file I want to import. This has a
precedence constraint mapped to the SQL Server table destination defined above. Somewhere in there I need to
map the variable to ther market column.

I have no idea how to do that. Please point me in the right direction, thanks.

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.