Learn how to a build a cloud-first strategyRegister Now

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

sql syntax for Data Driven Query

Hi,

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 :-

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

Any thoughts to what we are doing wrong?

Thanks.

James.
0
JAMES
Asked:
JAMES
  • 2
  • 2
1 Solution
 
KarinLoosCommented:
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?
0
 
JAMESAuthor Commented:
We dont set them - we assumed they would be populated from the "source" table as they are mapped in the transformations tab.
0
 
KarinLoosCommented:
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
www.sqldts.com

0
 
JAMESAuthor Commented:
Great thanks.

0

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