[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

DTS - dynamic filename on runtime

Posted on 2000-04-19
2
Medium Priority
?
3,067 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
ca_heckler earned 70 total points
ID: 2731890
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 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2732105
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

656 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