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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top