Full migration of SQL Server database _ MySQL

Source: Internet
Author: User
Tags sql server management
Full migration of SQL Server database bitsCN.com

Use Microsoft SQL Server Management tool to move databases

Click the Start menu, select SQL Server management tools, and enter SQL Server in the quick search column.

Search bar


SQL Server Management Tools


Select the SQL Server Management tool to display the main interface, which is used to restore the main work area of the backup database.
Use Microsoft SQL Server Management tool to move databases

Click the Start menu, select SQL Server management tools, and enter SQL Server in the quick search column.

Search bar


SQL Server Management Tools


Select the SQL Server Management tool to display the main interface, which is used to restore the main work area of the backup database.

Restore database


Note: we will assume that you already know how to back up an SQL Server database and have stored the backup database on a file Server or copied the backup to a new Server. We will introduce it based on this.

Open the management tool, right-click the database and choose recover database.

This article introduces a clever SQL technique. for details, refer to the following:

The problem is as follows:

There is a table structure:

Fphm, kshm
Int32 00000001
Int32 00000002
Int32 00000003
Int32 00000004
Int32 00000005
Int32 00000007
Int32 00000008
Int32 00000009
Maid
Maid
Maid
Maid
Maid

(Note: The second field may contain continuous data and may contain breakpoints .)

How can we query such results and query continuous records.

This example is similar to the following:

Int32 00000001, 00000005
00000007
Maid, 00000122
00000125

The following is a clever solution:

SQL> SELECT B. fphm, MIN (B. kshm) Start_HM, MAX (B. kshm) End_HM
2 FROM (SELECT a. *, TO_NUMBER (a. kshm-ROWNUM) cc
3 FROM (SELECT *
4 FROM t
5 order by fphm, kshm) a) B
6 group by B. fphm, B. cc
7/

FPHM START_HM END_HM
--------------------------
2013 00000120 00000122
2013 00000124 00000125
2014 00000001 00000005
2014 00000007 00000009

Restore database


Note: we will assume that you already know how to back up an SQL Server database and have stored the backup database on a file Server or copied the backup to a new Server. We will introduce it based on this.

Open the management tool, right-click the database and choose recover database.

BitsCN.com

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.