Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > SQL Query
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 11th April 00:02
aleks
External User
 
Posts: 1
Default SQL Query



Hi,

I need to copy over some values from table # 1 to table # 2 and I need a
little help doing so, here is the info, maybe someone can help me out
creating this query.

Table # 1

field1 : attachment_id (int)
field2: user_id (int)

Table # 2

field1: attachment_id (int)
field2: Object_id (int)

I need to copy over for all records in table one field # 1 to field # 1 in
table # 2 and field # 2 to field # 2 in table 2.

I think this is simple, just never done it before.

Any help appreciated.

A
  Reply With Quote


  sponsored links


2 11th April 00:02
amit
External User
 
Posts: 1
Default SQL Query



Try this:

Insert into Table2 (attachment_id, object_id)
Select attachment_id, user_id as object_id
from Table1
  Reply With Quote
3 11th April 00:02
aleks
External User
 
Posts: 1
Default SQL Query


Excelent, thanks !

Aleks
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666