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