How to assign value of one column to another using Inline sql query?

  • Thread starter Thread starter asgars
  • Start date Start date
A

asgars

I have a inline SQL query in a VB.NET. It is something like this...

UPDATE EMPLOYEE SET NAME = ?, CONTACT= ?, OLDCONTACT = ?,

This is working fine when i assign a value for each of '?' marks using
SQLParameter. But here i need to copy one column's value into another
column. Like I want to copy the value of CONTACT column into
OLDCONTACT column.

I know this can be done easily by a using stored proc, like

UPDATE EMPLOYEE SET OLDCONTACT = CONTACT
(where OLDCONTACT and CONTACT are column of same table.)

How can I do it using inline query (the one shown above with question
marks)???
 
Hello,
I know this can be done easily by a using stored proc, like

UPDATE EMPLOYEE SET OLDCONTACT = CONTACT
(where OLDCONTACT and CONTACT are column of same table.)

Same than what you shown above with possibly a where clause. What have you
tried that doesn't work ?
 
Back
Top