Bulk Insert Task w/ Global Variables

  • All,

    Thank you in advance for your time and assistance.

    We are running Microsoft SQL Server 2000 and are in the process of redesigning our database.  As a result, there are about 60 tables in the new design that have no corresponding table or data in the current design.  Since the migration process is going to start with the creation of the new database structure on the production server, I am creating DTS packages to populate these "brand new" tables.  Since I cannot guarantee the existence or availability of the development database at the time of migration, I have created a csv file for each of the "brand new" tables.  I am using the Bulk Insert Task to insert data into each table from its corresponding csv file.  We are planning to perform several test runs of the migration on the development server before doing it on the production server.  Since the directory structures for the development server and the production server are not the same, I want to use global variables to store the drive and path information for the location of the csv files.  However, in the Dynamic Properties Task tool in DTS Designer, there does not appear to be a way of combining global variables and literal strings to form a value for the Datafile property of the Bulk Insert Task.

    Does anyone know how I might be able to set up the task so that I can change the drive and filepath variables in one place and don't have to change 60 destination files.

    Thank you agian.

    VR,

    Robert

  • You could make use the dynamic properties task to execute a query against a table holding the information for all the files.



    Shamless self promotion - read my blog http://sirsql.net

  • I second that.  Create a table that stores all of your path/file information and use that in conjunction with the Dynamic Properties task.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply