SQL Server dummies tutorial-Table backup

Source: Internet
Author: User

Hello everyone, we know that the greatest difficulty for large software such as ERP lies in the arrangement and maintenance of large databases.

Table backup, as its name implies, backs up a table.

 

So when do we need table backup?

Table backup is a temporary backup when you test the stored procedure or delete a table that has important data in a large ERP Database.

 

Table backup is a required course for SQL experts. Let's not talk about it.

-- Create a temporary data first. Create Table # tab (ID int, country nvarchar (10), sex int, popu INT) insert into # tab values (1, 'China', 1, '123 ') insert into # tab values (2, 'China', 2, '000000') insert into # tab values (3, 'u.s. ', 1, '45 ') insert into # tab values (4, 'America ', 2, '55') insert into # tab values (5, 'Canada', 1, '51 ') insert into # tab values (6, 'Canada ', 2, '49') insert into # tab values (7, 'uk', 1, '40 ') insert into # tab values (8, 'uk ', 2, '60') Select * from # Tab

 

One of the table backup Syntax: temporary table --> temporary table backup

-- In this case, we put the # tab into a # tab2 to select * into # tab2 from # Tab

We can query # tab2 to get the result.

 

Table backup syntax 2: temporary table --> physical table backup

SELECT * INTO MyERP.dbo.MyTab FROM #tab

OK, so we can store the data in our temporary table directly to quickly create an entity table.

The query content is the same

 

 

Table backup syntax 3: entity table --> entity table backup

SELECT * INTO MyERP.dbo.MyTab2 FROM MyERP.dbo.MyTab

In this case, the object table mytab obtains mytab2.

The data is also obtained.

 

 

Continue to extend... IP host-IP host table backup

This topic is a little dangerous and may be a little complicated. It involves some gateway problems, but you can imagine the principle of database loss for several large websites a while ago. Do not underestimate the basics. Experts use these foundations together.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.