Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

DTS Parameter on Execute SQL Task

 
   Database Forums (Home) -> DTS RSS
Next:  can I combine several partitions into one in a cu..  
Author Message
Chris224

External


Since: Aug 12, 2004
Posts: 50



(Msg. 1) Posted: Mon Oct 17, 2005 11:21 am
Post subject: DTS Parameter on Execute SQL Task
Archived from groups: microsoft>public>sqlserver>dts (more info?)

First I am trying to use DTS for purging data. The first thing I want to do
is export the data to be purged to a csv file. I am using parameters to hold
variables such as dates.

The export routines work using transform data task using the following query:

select sub.* from proddta.f3102 as sub
join proddta.f4801 as main on sub.igdoco=main.wadoco
where main.watrdj<?

the parameter is named FIRSTOFLASTYEAR as an unsigned int 4 with a value of
104001 (our software uses integers to represent dates)

The next step I am trying to do is to use an execute sql task to delete the
affected data. The query is below:

delete sub from proddta.f3102 as sub
join proddta.f4801 as main on sub.igdoco=main.wadoco
where main.watrdj<?

When trying to assign the parameter I get an error saying "invalid object
name sub". It also won't parse the sql. However, if I replace the ? with
the 104001 then everything parses correctly.

What am I doing wrong?

Thanks in advance

Chris

 >> Stay informed about: DTS Parameter on Execute SQL Task 
Back to top
Login to vote
uykusuz

External


Since: May 12, 2005
Posts: 4



(Msg. 2) Posted: Mon Oct 17, 2005 3:55 pm
Post subject: Re: DTS Parameter on Execute SQL Task [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

this is probably a bug of sql parser. i remember old threads about this
issue.
first write a simple query , map parameters , then change your query. it
would work ,even when you get this error.
another solution would be creating the sql query in an activex script task
, then setting the query of execute sql task..



"Chris" wrote in message

> First I am trying to use DTS for purging data. The first thing I want to
do
> is export the data to be purged to a csv file. I am using parameters to
hold
> variables such as dates.
>
> The export routines work using transform data task using the following
query:
>
> select sub.* from proddta.f3102 as sub
> join proddta.f4801 as main on sub.igdoco=main.wadoco
> where main.watrdj<?
>
> the parameter is named FIRSTOFLASTYEAR as an unsigned int 4 with a value
of
> 104001 (our software uses integers to represent dates)
>
> The next step I am trying to do is to use an execute sql task to delete
the
> affected data. The query is below:
>
> delete sub from proddta.f3102 as sub
> join proddta.f4801 as main on sub.igdoco=main.wadoco
> where main.watrdj<?
>
> When trying to assign the parameter I get an error saying "invalid object
> name sub". It also won't parse the sql. However, if I replace the ? with
> the 104001 then everything parses correctly.
>
> What am I doing wrong?
>
> Thanks in advance
>
> Chris

 >> Stay informed about: DTS Parameter on Execute SQL Task 
Back to top
Login to vote
uykusuz

External


Since: May 12, 2005
Posts: 4



(Msg. 3) Posted: Mon Oct 17, 2005 3:55 pm
Post subject: Re: DTS Parameter on Execute SQL Task [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

this is probably a bug of sql parser. i remember old threads about this
issue.
first write a simple query , map parameters , then change your query. it
would work ,even when you get this error.
another solution would be creating the sql query in an activex script task
, then setting the query of execute sql task..



"Chris" wrote in message

> First I am trying to use DTS for purging data. The first thing I want to
do
> is export the data to be purged to a csv file. I am using parameters to
hold
> variables such as dates.
>
> The export routines work using transform data task using the following
query:
>
> select sub.* from proddta.f3102 as sub
> join proddta.f4801 as main on sub.igdoco=main.wadoco
> where main.watrdj<?
>
> the parameter is named FIRSTOFLASTYEAR as an unsigned int 4 with a value
of
> 104001 (our software uses integers to represent dates)
>
> The next step I am trying to do is to use an execute sql task to delete
the
> affected data. The query is below:
>
> delete sub from proddta.f3102 as sub
> join proddta.f4801 as main on sub.igdoco=main.wadoco
> where main.watrdj<?
>
> When trying to assign the parameter I get an error saying "invalid object
> name sub". It also won't parse the sql. However, if I replace the ? with
> the 104001 then everything parses correctly.
>
> What am I doing wrong?
>
> Thanks in advance
>
> Chris
 >> Stay informed about: DTS Parameter on Execute SQL Task 
Back to top
Login to vote
Chris224

External


Since: Aug 12, 2004
Posts: 50



(Msg. 4) Posted: Tue Oct 18, 2005 7:39 am
Post subject: RE: DTS Parameter on Execute SQL Task [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thank you very much for all the quick responses. That solution fixed the
problem!

Chris

"Chris" wrote:

> First I am trying to use DTS for purging data. The first thing I want to do
> is export the data to be purged to a csv file. I am using parameters to hold
> variables such as dates.
>
> The export routines work using transform data task using the following query:
>
> select sub.* from proddta.f3102 as sub
> join proddta.f4801 as main on sub.igdoco=main.wadoco
> where main.watrdj<?
>
> the parameter is named FIRSTOFLASTYEAR as an unsigned int 4 with a value of
> 104001 (our software uses integers to represent dates)
>
> The next step I am trying to do is to use an execute sql task to delete the
> affected data. The query is below:
>
> delete sub from proddta.f3102 as sub
> join proddta.f4801 as main on sub.igdoco=main.wadoco
> where main.watrdj<?
>
> When trying to assign the parameter I get an error saying "invalid object
> name sub". It also won't parse the sql. However, if I replace the ? with
> the 104001 then everything parses correctly.
>
> What am I doing wrong?
>
> Thanks in advance
>
> Chris
 >> Stay informed about: DTS Parameter on Execute SQL Task 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
DTS "Execute SQL Task" - I have a Execute SQL Task that copy/transfer a big SQL table by executing: insert into .... select ... from .... Is there any benefit to run the sql in DTS (batch/lock handling)? Or it's the same to run it use Job schedule or just isqlw?

Configure Execute Package Task - Hi, Any one can provide information about configuring a execute package task? Thanks,

Exec Sql Task Parameter to ## stored proc - I have an SSIS package using an exec sql task being past a variable. The variable is mapped to a parameter that is then passed to a ## stored procedure within the sql task, and I am getting the following error. Unable to derive parameter information for...

can i create dynamic execute SQL task ? - Hi All, i have a existing DTS package, however the execute SQL task keep changing, instead, i will create one table to store those execute SP name and using query to run for it. do you think the idea is possible?

How to pass a null parameter to a SP executed in an execut.. - I have a SSIS package that I am trying to execute a stored procedure (the stored procedure references a linked server) within a execute sql object. The stored procedure has two parameters. I am passing the one parameter to the SSIS package upon..
   Database Forums (Home) -> DTS All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]