Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Copy from 1 SQL table to another?

Thread Tools
 
Search this Thread
 
Old 19 August 2003, 11:23 AM
  #1  
rik1471
Scooby Regular
Thread Starter
 
rik1471's Avatar
 
Join Date: Nov 2001
Posts: 4,788
Likes: 0
Received 0 Likes on 0 Posts
Post

I have an SQL server with 2 tables with the same structure. How do I copy records from one table to the other easily?
Old 19 August 2003, 11:27 AM
  #2  
GaryK
Scooby Regular
 
GaryK's Avatar
 
Join Date: Sep 1999
Location: Bedfordshire
Posts: 4,037
Likes: 0
Received 0 Likes on 0 Posts
Post

rik,

easiest way is to do

INSERT INTO <table2> FROM SELECT * FROM <table1>

if you have an identity field then you will need to issue a SET IDENTITY INSERT <table2> OFF (or maybe ON cant remember!)

Gary
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
JonMc
Subaru Parts
22
06 February 2016 09:50 PM
IAN WR1
ScoobyNet General
8
28 September 2015 08:14 PM
Littleted
Computer & Technology Related
0
25 September 2015 08:44 AM
ossett2k2
Engine Management and ECU Remapping
15
23 September 2015 09:11 AM
pimmo2000
Computer & Technology Related
2
21 September 2015 12:04 PM



Quick Reply: Copy from 1 SQL table to another?



All times are GMT +1. The time now is 05:40 AM.