dbTalk Databases Forums  

problem with data driven query task

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss problem with data driven query task in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Koen Appeltans
 
Posts: n/a

Default problem with data driven query task - 05-10-2004 , 08:54 AM






hello,

I'd like to use a global variable in the source sql-query of a data
driven query task.
I simply use a ? for the parameter. My database connection is a
Microsoft OLE DB provider for sql-server.

The problem is that he doesn't accept this syntax, he gives a
syntax-error and when I remove the question mark it works.

Unfortunately I don't have any inspiration how I should resolve this.
It must be posible to access a global variable from within this query
I suppose.

Anyone an idea ?

Tnx in advance,

Koen

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: problem with data driven query task - 05-10-2004 , 10:25 AM






Which version of SQL Server?
What is the syntax you are using?


--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Koen Appeltans" <koen (AT) sdt-informatics (DOT) be> wrote

Quote:
hello,

I'd like to use a global variable in the source sql-query of a data
driven query task.
I simply use a ? for the parameter. My database connection is a
Microsoft OLE DB provider for sql-server.

The problem is that he doesn't accept this syntax, he gives a
syntax-error and when I remove the question mark it works.

Unfortunately I don't have any inspiration how I should resolve this.
It must be posible to access a global variable from within this query
I suppose.

Anyone an idea ?

Tnx in advance,

Koen



Reply With Quote
  #3  
Old   
Koen Appeltans
 
Posts: n/a

Default Re: problem with data driven query task - 05-11-2004 , 03:02 AM



Hi,

My version of sql-server is SQL-Server 2000.

A part of the source query of the data driven query task is :

declare @LaatsteSynchronisatie datetime

-- begin instellen op lang geleden
set @LaatsteSynchronisatie = '1978-01-01'

select @LaatsteSynchronisatie = LaatsteSynchronisatie from
dbo.Synchronisatie
where VertegenwoordigerID = 1

The 1 should be replaced by a global variable : so I replaced it with
a question mark, but when I do this he gives a Syntax error on the
query, and I can't link the question mark to a global variable.

I suppose that this normally should work ?

Kind regards,

Koen Appeltans



"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
Which version of SQL Server?
What is the syntax you are using?


--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Koen Appeltans" <koen (AT) sdt-informatics (DOT) be> wrote in message
news:ca4734f1.0405100554.58415173 (AT) posting (DOT) google.com...
hello,

I'd like to use a global variable in the source sql-query of a data
driven query task.
I simply use a ? for the parameter. My database connection is a
Microsoft OLE DB provider for sql-server.

The problem is that he doesn't accept this syntax, he gives a
syntax-error and when I remove the question mark it works.

Unfortunately I don't have any inspiration how I should resolve this.
It must be posible to access a global variable from within this query
I suppose.

Anyone an idea ?

Tnx in advance,

Koen

Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: problem with data driven query task - 05-11-2004 , 03:27 AM



Your query doesn't make sense in this context.

You want to use a variable where you currently use the 1

......where VertegenwoordigerID = ?


What exactly are you trying to do in the Query?


--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Koen Appeltans" <koen (AT) sdt-informatics (DOT) be> wrote

Quote:
Hi,

My version of sql-server is SQL-Server 2000.

A part of the source query of the data driven query task is :

declare @LaatsteSynchronisatie datetime

-- begin instellen op lang geleden
set @LaatsteSynchronisatie = '1978-01-01'

select @LaatsteSynchronisatie = LaatsteSynchronisatie from
dbo.Synchronisatie
where VertegenwoordigerID = 1

The 1 should be replaced by a global variable : so I replaced it with
a question mark, but when I do this he gives a Syntax error on the
query, and I can't link the question mark to a global variable.

I suppose that this normally should work ?

Kind regards,

Koen Appeltans



"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Which version of SQL Server?
What is the syntax you are using?


--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Koen Appeltans" <koen (AT) sdt-informatics (DOT) be> wrote in message
news:ca4734f1.0405100554.58415173 (AT) posting (DOT) google.com...
hello,

I'd like to use a global variable in the source sql-query of a data
driven query task.
I simply use a ? for the parameter. My database connection is a
Microsoft OLE DB provider for sql-server.

The problem is that he doesn't accept this syntax, he gives a
syntax-error and when I remove the question mark it works.

Unfortunately I don't have any inspiration how I should resolve this.
It must be posible to access a global variable from within this query
I suppose.

Anyone an idea ?

Tnx in advance,

Koen



Reply With Quote
  #5  
Old   
Koen Appeltans
 
Posts: n/a

Default Re: problem with data driven query task - 05-11-2004 , 06:50 AM




Ok, i'll give an example for a query :

let's say I want a list of customers for one salesman (every salesman
has his onw list of customers)

so the query is +- :

select * from customers
where salesmanID = ?

and the salesmanID is a global variable of the package.


But I'm particullary wondering why I can't make use of parameters in
this context (source query).

Kind regards,

Koen Appeltans

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #6  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: problem with data driven query task - 05-11-2004 , 07:00 AM



You are using SQL Server 2000 ?

If you are then what happens when you enter the Query?
What happens when you hit the Parameters button


If you are not using 2000 then you may want to use this

Global Variables and SQL statements in DTS
(http://www.sqldts.com/Default.aspx?205)

--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Koen Appeltans" <koen (AT) sdt-informatics (DOT) be> wrote

Quote:
Ok, i'll give an example for a query :

let's say I want a list of customers for one salesman (every salesman
has his onw list of customers)

so the query is +- :

select * from customers
where salesmanID = ?

and the salesmanID is a global variable of the package.


But I'm particullary wondering why I can't make use of parameters in
this context (source query).

Kind regards,

Koen Appeltans

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply With Quote
  #7  
Old   
Koen Appeltans
 
Posts: n/a

Default Re: problem with data driven query task - 05-11-2004 , 07:31 AM




Yes I'm using SQL-Server 2000.
When I hit or the 'parameters'-button or the 'parse query'-button he
gives a messagebox :
package error
Error source : Microsoft OLE DB provider for SQL Server
Error description : Syntax error.

, when there's a question mark in the query.
When there's no question mark in the query, the query is accepted.

Koen

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #8  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: problem with data driven query task - 05-11-2004 , 07:40 AM



What is the exact query used?

--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Koen Appeltans" <koen (AT) sdt-informatics (DOT) be> wrote

Quote:
Yes I'm using SQL-Server 2000.
When I hit or the 'parameters'-button or the 'parse query'-button he
gives a messagebox :
package error
Error source : Microsoft OLE DB provider for SQL Server
Error description : Syntax error.

, when there's a question mark in the query.
When there's no question mark in the query, the query is accepted.

Koen

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply With Quote
  #9  
Old   
Koen Appeltans
 
Posts: n/a

Default Re: problem with data driven query task - 05-11-2004 , 08:53 AM




Allan,

I've found a clue on what the cause might be.
On my desktop I have MSDE 2000 installed + SQL Server 2000 client
utilities. When I make a package on the server (Sql Server 2000
installed), then there is no problem with including parameters in the
query.

But the problems remains because I want to execute a package from MSDE
Clients to a Microsoft Sql Server.

Do you have any knowlegde of differences between MSDE 2000 and
SQL-Server 2000 ?

Kind regards,

Koen

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.