home
training courses
why choose us?
solutions
support
company
LearnItFirst User Forum
Welcome Guest
Search
|
New Posts
|
Members
|
Log In
|
Register
SQL Server Forum - LearnItFirst.com
»
SQL Server Database Administration
»
Integration Services (SSIS) and DTS
»
Looping through Variables in DTS
Looping through Variables in DTS
Options
Previous Topic
·
Next Topic
zBeare
Posted:
Monday, October 13, 2008 10:03:02 PM
Rank: Newbie
Joined: 10/13/2008
Posts: 1
Points: 3
Where do you live?: Melbourne, Down Under
I have a situation where I need to run six rolling month reports and generate six individual text file outputs.
Currently I have SQL that does the job for me. I declare @YEAR variable and @MONTH variable, set the QUERY ANALYSER to output result to File, set a value for each of the two variables and run the SQL six times.
The variables are used in several places throught the SQL to create stagingtables, matching criteria and retrict output. It would also be nice to use them in the output filename (but this is currently manual).
I'm really new at this, but I was hoping I could load all this into a DTS package, set the startMotnh and startYear and have the package then loop through - incrementing by one month six times and then running the extract into discreet files.
I have a sense that this should be done using activeX and global variables and was hoping somone could give me a few pointers.
I suspect that to be used in DTS - rather than having one long SQL script - I will probably need to break it up into steps and run each step as a separte DTS step as well.
Back to top
Users browsing this topic
Guest
Forum Jump
SQL Server Database Administration
- General SQL Database Question & Answer
- Backup, Recovery and Disaster Recovery
- SQL Server Security
- Integration Services (SSIS) and DTS
Transact-SQL Programming
- DML (SELECT, INSERT, UPDATE, DELETE) Questions
- Stored Procedures, Triggers, & Functions
SQL Server Scripts, Code Samples and SSMS Custom Reports
- All SQL Server Versions
- SQL Server 2005/2008
- SQL Server Management Studio Custom Reports
Customer Service
- Video Requests
You
cannot
post new topics in this forum.
You
cannot
reply to topics in this forum.
You
cannot
delete your posts in this forum.
You
cannot
edit your posts in this forum.
You
cannot
create polls in this forum.
You
cannot
vote in polls in this forum.
SQL Server 2005 DBA Training Videos
SQL Server 2008 DBA Training Videos
Email this topic
RSS Feed
Watch this topic
Print this topic
Normal
Threaded