Home > Support > Knowledge Base > Article

FAQ: Using SQL Data Scripting Tool

With SQL Data Scripting Tool, you can quickly and easily script virtually any type of data in a Microsoft® SQL Server™ 2000 Database, regardless of its size. Just click a topic on the left to get started with SQL Data Scripting Tool.

SQL Server Setup

If you haven't already done so, you'll need to install and configure Microsoft® SQL Server™ 2000 before you can use SQL Data Scripting Tool. Please refer to the Microsoft® SQL Server™ 2000 documentation for instructions on how to do so.

Where?

  1. Log onto a computer which has the SQL Server client tools installed.
  2. Click the Start button.
  3. Point to Programs, Microsoft SQL Server.
  4. Click Books Online.

Selecting a Database

The Select Database screen allows you to select the SQL Server and database which contains the tables to script. To select the database:

  1. Enter the name of the SQL Server on which the database is stored.
  2. If you log on using SQL Server authentication, enter your SQL Server Username and Password. Alternatively, if you log on using Windows authentication, check the Use Integrated Windows Security checkbox.
  3. Click the Connect button to connect to the server and retrieve a list of the databases stored on the server.
  4. Select the database which contains the tables you want to script in the Database drop-down list.
  5. Click the Next button.

Selecting the Tables/Views to Script

  1. Select the table(s) and view(s) you wish to script from the list. To select all Tables, Click Select all. To deselect all tables, click Deselect all.
  2. Click the next button.

Note: In order for the script to run successfully when views are selected, the views must be updateable. For more information, see Microsoft SQL Server 2000 Books Online.

Advanced Options

  1. To generate DELETE statements to delete all data from the database before running the INSERT statements, check the Generate DELETE statements checkbox.
  2. To only script a certain number of rows, select the Maximum number of rows to script checkbox, and enter a value.
  3. Click the next button to run the script. Wait while the the script is generated. This can take several minutes for a very large database, or if the server is busy.

Note: If you checked the Generate DELETE statements checkbox, a warning message will be displayed. An error will be displayed if the database contains IMAGE columns, because the data in these columns will be lost if the script is run, and a warning is displayed if the database contains TIMESTAMP columns, because the data in these columns will be generated if the script is run.

Note: If the product is unregistered, the Maximum number of rows to script option will be unavailable. The unregistered version will only script the first 10 rows in each table.

Running the SQL Script

  1. Open SQL Server Query Analyser.
  2. Enter the settings to connect to the database.
  3. Paste the text inside the script file into the query window.
  4. Press F5 to execute the query. If you selected the Generate DELETE Statements option when creating the script, all data will be deleted from the selected tables before new data is inserted.

Note: It is recommended that you ensure that ALL clients are disconnected FROM the server before executing the query, otherwise data corruption and/or loss could result as all foreign constraints and triggers are disabled while the data is being inserted.

Other Articles