Click to See Complete Forum and Search --> : Copying Columns to Columns in a table (sql 7.0)


David Satz
04-09-2002, 09:49 AM
you would just need to run:

UPDATE table
SET COLUMN3 = COLUMN1
, COLUMN4 = COLUMN2

and if needed, create a stored proc for this
--
HTH,
David Satz
Principal Web Engineer
Hyperion Solutions
{ SQL Server 2000 SP2/6.5 SP5a } { Cold Fusion 5 SP1 } { VSS }
(Please reply to group only - emails answered rarely)
-----------------------------------------------------------------
"Sara" <sara.scott@everton.con> wrote in message
news:3cb2e7f9$1@10.1.10.29...
>
> Hi,
>
> I created a vb program that updates 2 columns in a SQL Server 7.0
database.
>
>
> Say, the 2 columns were named COLUMN1 and COLUMN2.
> We then added 2 new columns to the table named COLUMN3 and COLUMN4.
>
> How can I copy the data in COLUMN1 into COLUMN3 and COLUMN2 into COLUMN4?
> I wish to use a Stored Procedure to do this and possibly run it through
SQL
> Query Analyzer. Can anybody give an example of a Stored procedure required
> to do this?
>
> Thanks,
> Sara

Sara
04-09-2002, 10:09 AM
Hi,

I created a vb program that updates 2 columns in a SQL Server 7.0 database.


Say, the 2 columns were named COLUMN1 and COLUMN2.
We then added 2 new columns to the table named COLUMN3 and COLUMN4.

How can I copy the data in COLUMN1 into COLUMN3 and COLUMN2 into COLUMN4?
I wish to use a Stored Procedure to do this and possibly run it through SQL
Query Analyzer. Can anybody give an example of a Stored procedure required
to do this?

Thanks,
Sara

Sara
04-09-2002, 11:04 AM
Thanks!