Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1261
  • Last Modified:

sql syntax for Data Driven Query


I am quite new to DTS but have decided (so far anyway) that a Data Driven Query is the solution to my problem of keeping a SQL Server database updated from an old Sybase Adaptive Server anywhere db.

We originally used the Transform data task which is great and fast but we need to ability to update the record if it exists in the destination the next time the transfer is done.

We have placed a Data Driven Query in our visual editor within EM and have set (what we think) it up correctly but when we try and run it we receive the following error :-

Error Source : Microsoft Data Transformation Services (DTS) Data Pump
Error Description : DataDrivenQuery: No query specification returned by Transform Status.

Here is the basic (for our test) query for INSERT :-

INTO TicketHeaders(TicketNumber, Contract, Currency, Exchange)
VALUES     (?, ?,?,?)

Any thoughts to what we are doing wrong?


  • 2
  • 2
1 Solution
Could you give some more information please -->
 ie the paramater place holders you have in the insert statement
have they been assigned to global variables, where do you set these global variables?
JAMESAuthor Commented:
We dont set them - we assumed they would be populated from the "source" table as they are mapped in the transformations tab.
nope thats your problem, the parameter place holders are for inputs into a query and must be set explicitly
You willl notice the parameter tab on the DataDriveQuery task , when you click this then you will notice a list in which  you assign global variables to the parameters.

What you rather want to do , is  program the logic into the ActiveXScript of the Transform Task (DTSDestination...  = DTSSource... ),
You could make use of the Lookups here .. Lookup will return a single value for each processed row from which you could for example
determine if the record already exists.

You would check out this site, it is an excellent resource for DTS programming

JAMESAuthor Commented:
Great thanks.


Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now