Monday, February 20, 2012

Move Data from Schema to schema

Hi
I have two schemas in same database here is the detail
Source
schema : Imac_admin
table name :Part
Column name : Part ID
Target :
Schema - Customer
Table : product_xref
Coumn : Webpartid
Need to move data from Part id to webpart id"san" <skrupareliya@.gmail.com> wrote in message
news:1142026409.975993.305480@.i39g2000cwa.googlegroups.com...
> Hi
>
> I have two schemas in same database here is the detail
> Source
> schema : Imac_admin
> table name :Part
> Column name : Part ID
> Target :
> Schema - Customer
> Table : product_xref
> Coumn : Webpartid
> Need to move data from Part id to webpart id
>
I guess you'll want an UPDATE statement with two-part object names:
UPDATE Customer.product_xref
SET webpartid =
(SELECT part_id
FROM Imac_admin.Part
WHERE ... /* ' not specified */)
WHERE ... /* ' not specified */ ;
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--

No comments:

Post a Comment