?
Solved

DTS Structure Help

Posted on 2006-06-05
6
Medium Priority
?
261 Views
Last Modified: 2013-11-30
Hello,

i am new when it comes to DTS in SQL Server. I want to do the Following.


Generate a Text File on weekly bases from a SQL Server 2000 DB.
after File is been generated i want to store the ID number of Each row(that was inserted into a text file) into another table (such as a Log Table).

So i know the first Step. Like

 Data Source (SQL Server Table) ----------> Text File (Destination)

This works fine, generates the Text file, but then how do i Execute a SQL Query to insert Records into a Table(storing whatever was inserted into the Text File).

I mean how do we define steps, i am so confused about defining Steps in DTS Like from here to There and there to execute a batch or what so ever.

Thanks
0
Comment
Question by:Saqib Khan
  • 4
  • 2
6 Comments
 
LVL 20

Expert Comment

by:Sirees
ID: 16834007

<< how do i Execute a SQL Query to insert Records into a Table >>

What do you actually want to do? Do you want to insert the records in the text file into another table?

To execute a sql query you can use "execute SQL Task"

<<i am so confused about defining Steps in DTS Like from here to There and there to execute a batch or what so ever.>>

you should choose two items and then go to workflow tab and choose the appropriate work flow task.
0
 
LVL 23

Author Comment

by:Saqib Khan
ID: 16834048
here is what I want

Step 1 : Generate a Text File From a SQL Server Table
Step 2 : after File is generated, whatever Records were inserted into the Text file I want to store them into another Table as a Log (say the ID field for each record)
0
 
LVL 23

Author Comment

by:Saqib Khan
ID: 16834488
as you advised, i clicked on SQL Connection(Source) and Text file(destination), both Selected and then I clicked on WorkFlow "on success" . i get this error message..

"Defining precedences beetween the selected items is not valid"

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 20

Accepted Solution

by:
Sirees earned 2000 total points
ID: 16834735
you cannot select workflow between the SQL Connection and text file. You have to choose the transform data task.

<<Step 1 : Generate a Text File From a SQL Server Table >>

Create SQL Connection and text file. Select transform data task between these two tasks.

<<Step 2 : after File is generated, whatever Records were inserted into the Text file I want to store them into another Table as a Log (say the ID field for each record) >>

Select execute SQL task and wrtie the query there to get whatever rows are inserted into text file. Choose this execute SQL Task ans the text file which you created and then choose work flow "on Success". (i.e. your task will only be executed if the text file is created).

0
 
LVL 23

Author Comment

by:Saqib Khan
ID: 16834898
is it ok if the do the following.

up to Step 1 as you mention.

on Step Two choose Source Text File and Sql ServerDestination. this will import results into Log table from source file.
after this process is done, is there a method to empty/clear the content in text file?

thanks
0
 
LVL 23

Author Comment

by:Saqib Khan
ID: 16857239
in DTS, how does it know "what is the very First Step", or it looks for any object that has no "workflow" executes first?
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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.
Suggested Courses

569 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