Solved

DTS - dynamic filename on runtime

Posted on 2000-04-19
2
3,052 Views
Last Modified: 2013-11-30
I'm using DTS to export from SQL Server to text file(about 1,000,000 rows).
I want to change the target file dynamic from the VB Script on runtime, so i can put only 2,000 rows for each file.
Is there any easy way to do that?
0
Comment
Question by:tomerka
2 Comments
 
LVL 1

Accepted Solution

by:
ca_heckler earned 35 total points
Comment Utility
You could write your transform to take as a source a Stored Proc that only returns a fraction of your data. Then, from VB or VBA you create a Transformation Object, load your transformation and fire a few times, passing different parameters to the SP
(and changing the target file-name).
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
I did already launch Packages from VB (Scrip), and change connection (including text file connections) settings like the filename.
You could combine this, in creating a DTS that opens your existing package, changes the target filename, and execute the package (your need to control the "next" 2000 rows using a Proc or View using TOP 2000 and a where clause to ensure rows are not returned twice).

To open and execute a package, you need to do somethings like this:
DIM objPackage
SET objPackage = CreateObject("DTS.Package")
objPackage.LoadFromSQLServer ( "here comes a series of parameters like server, packagename, username and password")
objPackage.Execute
Set objPackage = NOTHING

to access/change the connection settings, you need to analyse the package properties, check the Connections collections to find your file, and there you need to change the ConnectionSource (or similar)

Hope this helps




0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MS SQL Bulk load data error 5 30
query help 18 50
Shop sales Actual vs Forecast 2 23
Test a query 23 0
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now