This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13555|Reply: 3

[Source] sqlserver how to copy one table for another

[Copy link]
Posted on 11/18/2017 10:09:28 PM | | |
SQL Server, if the target table exists:
insert into target table select * from original table;

SQL Server, if the target table does not exist:

select * into target table from original table;

In Oracle, if the target table exists:

insert into target table select * from original table;

commit;   

In Oracle, if the target table does not exist:

create table target table as select * from original table;




Previous:Session states cannot be serialized. In "StateServer" or "SQLServer" mode...
Next:To install IIS URL Rewriting Module 2, IIS version 7.0 or later is required
Posted on 11/20/2017 8:27:08 AM |
SQL basic writing syntax, not bad...
insert into  a1,a2,a3 from tb2   select a1,a2,a3 from tb1
 Landlord| Posted on 12/27/2017 10:05:00 PM |
insert into Test(uid,AppKey,IsEnable,_CreateTime) select Id,NEWID(),1,GETDATE() from Account;

Insert data into an existing data table
Posted on 1/5/2018 4:07:04 PM |
Update one table to another

update Table 1 set Mail = Table 2. Email from Table 1, Table 2 where Table 1. AccountId=Table 2. Id
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com