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

Discussion in 'ASP .Net' started by asgars, May 11, 2010.

  1. asgars

    asgars Guest

    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)???
     
    asgars, May 11, 2010
    #1
    1. Advertising

  2. asgars

    Patrice Guest

    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 ?
    --
    Patrice
     
    Patrice, May 11, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?ZGF2aWQ=?=
    Replies:
    11
    Views:
    1,022
    deandany
    Jul 17, 2006
  2. vishnu
    Replies:
    1
    Views:
    1,241
    Patrick.O.Ige
    Mar 25, 2006
  3. Anonymous
    Replies:
    0
    Views:
    1,532
    Anonymous
    Oct 13, 2005
  4. Rahul
    Replies:
    3
    Views:
    473
    James Kanze
    Feb 28, 2008
  5. Robert Cohen
    Replies:
    3
    Views:
    295
    Andrew Durstewitz
    Jul 15, 2003
Loading...

Share This Page