Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to assign value of one column to another using Inline sql query?

Reply
Thread Tools

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

 
 
asgars
Guest
Posts: n/a
 
      05-11-2010
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)???
 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      05-11-2010
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Multiple functions (one version being inline and other beingnon-inline) Rahul C++ 3 02-28-2008 03:28 PM
GridView - Setting the text of the 'select' column to the value of another column Greg Smith ASP .Net 0 04-12-2007 03:11 PM
How to assign a column of URLs to Hyperlink Column of a DataGrid c =?Utf-8?B?ZGF2aWQ=?= ASP .Net 11 07-17-2006 07:20 PM
bind a dropdown in a column in a datagrid based on the dropdown value selected in another column of the datagrid. vishnu ASP .Net 1 03-25-2006 01:24 PM



Advertisments