dbTalk Databases Forums  

Update Query in Execute SQL Task

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


Discuss Update Query in Execute SQL Task in the microsoft.public.sqlserver.dts forum.



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

Default Update Query in Execute SQL Task - 02-03-2005 , 02:05 AM






Hi,
I am trying to execute an update query in an Execute SQL Task of the
following kind:

update a

set a.emploeeno=b.employeeno,
a.employeename=b.employeename
a.employeeaddress=b.employeeaddress
a.lastmodifieddate=b.lastmodifieddate

from empintranet a, temp_empintranet b

where a.employeeno= b.employeeno
and b.lastmodifieddate > ?

But i am getting error messgaes saying that "a" is an invalid name. I am not
able to set parameters also. I even tried out using "tablename.columnname".
But that did not help. Kindly let me know what can be done regarding this.

Regards,
Puja

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

Default Re: Update Query in Execute SQL Task - 02-03-2005 , 01:07 PM






Yeah the ExecuteSQL task is a bit funny about the aliasing in an UPDATE

Use the fully qualified name



"Puja" <Puja (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,
I am trying to execute an update query in an Execute SQL Task of the
following kind:

update a

set a.emploeeno=b.employeeno,
a.employeename=b.employeename
a.employeeaddress=b.employeeaddress
a.lastmodifieddate=b.lastmodifieddate

from empintranet a, temp_empintranet b

where a.employeeno= b.employeeno
and b.lastmodifieddate > ?

But i am getting error messgaes saying that "a" is an invalid name. I am
not
able to set parameters also. I even tried out using
"tablename.columnname".
But that did not help. Kindly let me know what can be done regarding
this.

Regards,
Puja


Reply With Quote
  #3  
Old   
Puja
 
Posts: n/a

Default Re: Update Query in Execute SQL Task - 02-07-2005 , 01:13 AM



I have tried using the fully qualified name. But that does not help. My table
name is of the type "temp_xyz". so when i do temp_xyz.columnname, my query
fails.

Is there any other way, i can handle this query in a Execute SQL Task?

Regards,
Puja

"Allan Mitchell" wrote:

Quote:
Yeah the ExecuteSQL task is a bit funny about the aliasing in an UPDATE

Use the fully qualified name



"Puja" <Puja (AT) discussions (DOT) microsoft.com> wrote in message
news:Puja (AT) discussions (DOT) microsoft.com:
Hi,
I am trying to execute an update query in an Execute SQL Task of the
following kind:

update a

set a.emploeeno=b.employeeno,
a.employeename=b.employeename
a.employeeaddress=b.employeeaddress
a.lastmodifieddate=b.lastmodifieddate

from empintranet a, temp_empintranet b

where a.employeeno= b.employeeno
and b.lastmodifieddate > ?

But i am getting error messgaes saying that "a" is an invalid name. I am
not
able to set parameters also. I even tried out using
"tablename.columnname".
But that did not help. Kindly let me know what can be done regarding
this.

Regards,
Puja



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.