dbTalk Databases Forums  

parameters in Execute SQL Task with an update statement

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


Discuss parameters in Execute SQL Task with an update statement in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Larry Storm
 
Posts: n/a

Default parameters in Execute SQL Task with an update statement - 10-02-2003 , 12:14 PM






When I click the 'parameters' button, I get this error:
The column prefix 'pw' does not match with a table name or
alias name used in the query.
The column prefix 'x' does not match with a table name or
alias name used in the query.

Replacing the "?"s with hardcoded values works fine.

Here is the SQL Statement:
update roster_run_xref
set incl_sunday_ind = 1
from roster_run_xref x
inner join roster ro
on ro.roster_id = x.roster_id
and ro.time_table_version_id = x.time_table_version_id
inner join run r
on r.run_id = x.run_id
and r.time_table_version_id = x.time_table_version_id
inner join operator o
on o.operator_id = ro.signup_operator_id
inner join ltd_midas_operators_picked_work_per_bid pw
on pw.badge = o.badge
and pw.runnum = r.run_designator
where x.time_table_version_id = ?
and pw.pickid = ?
and pw.sun_run = 1

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

Default Re: parameters in Execute SQL Task with an update statement - 10-02-2003 , 02:21 PM






Can you try changing the statement to start

UPDATE X
SET.........................

same reason as this does not work

update authors
SET authors.au_id = authors.au_id
from authors a JOIN titleauthor ta on a.au_id = ta.au_id

and this does


update a
SET a.au_id = a.au_id
from authors a JOIN titleauthor ta on a.au_id = ta.au_id



--
--

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

"Larry Storm" <larry.storm (AT) ltd (DOT) org> wrote

Quote:
When I click the 'parameters' button, I get this error:
The column prefix 'pw' does not match with a table name or
alias name used in the query.
The column prefix 'x' does not match with a table name or
alias name used in the query.

Replacing the "?"s with hardcoded values works fine.

Here is the SQL Statement:
update roster_run_xref
set incl_sunday_ind = 1
from roster_run_xref x
inner join roster ro
on ro.roster_id = x.roster_id
and ro.time_table_version_id = x.time_table_version_id
inner join run r
on r.run_id = x.run_id
and r.time_table_version_id = x.time_table_version_id
inner join operator o
on o.operator_id = ro.signup_operator_id
inner join ltd_midas_operators_picked_work_per_bid pw
on pw.badge = o.badge
and pw.runnum = r.run_designator
where x.time_table_version_id = ?
and pw.pickid = ?
and pw.sun_run = 1



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.