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

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)???
 
P

Patrice

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 ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top