FAQ - Frequently Asked Question list - Answer.
Question: How to import saved scripts into MS SQL Server database?
Import saved scripts into database
There are two methods of saving data implemented in SQL Server Recovery Toolbox:
It should be noted that scripts in the SQL language may differ though they are based on the same database files. It is due to the peculiarities of syntax either in queries executed during the direct connection to the server via ADO or in SQL queries executed in the environment of Query Analyzer that comes together with MS SQL Server (the Go command, the use of :, etc.). The first method is more reliable, although the second method is more flexible and much more convenient.
1. Saving data to the disk as scripts
1.1. Data representation when it is saved to the disk
If you save data to the disk, a subdirectory with the name of the source MDF file will be created in the user-defined directory. Scripts will be saved to this directory. The name of each script consists of a word and a digit. The word indicates what the script does and the digit is its number. Scripts can be of the following types:
The number of a script does not convey any valuable information, it does not mean the order the scripts are executed in. It is necessary only to split data and save them to a number of small files instead of one big file. The maximum size of a file with an SQL script is specified by the user. Besides, we should pay particular attention to the numbering of Data files. First of all, data only for one table can be saved to each file of the Data type. All data for each of the tables is saved to files with sequential numbers.
Attention: Files with missing numbers mean that there is no data in some tables.
1.2. Order of executing scripts
The recommended order of executing scripts is the following:
The order scripts are executed in is based on the peculiarities of imposing constraints on existing structures and data in a table. In particular, the following issues should be taken into account:
1.3. Install.bat file
The program creates the file install.bat on the disk for the automatic execution of all scripts. This file will execute all scripts saved by the program. The order the scripts are executed in will be similar to the order of executing scripts on the database. For this batch file to run, the isqlw tool included in the client part of MS SQL Server must be installed on the computer. You should specify the following parameters in the command line for the file install.bat to run: “Server name”, “Database name”, “Username”, “Password”. For example: install.bat SQLServer SQLDatabase SQLUser SQLUserPassword
If you run the batch file install.bat without any parameters, a small instruction how to run this batch file will be shown.
|Recovery Toolbox, Inc.|
Search by Google