Executing a SQL File

You can execute a SQL file from the SQL File Editor or from WorkSpace Navigator.

Prerequisites 

Make sure the database server is running and you are connected to it through a connection profile.

Execute the SQL file using one of the following methods.
Option Description
From SQL File Editor
  1. In the WorkSpace Navigator project folder, double-click to open the SQL file in SQL File Editor.
  2. Right-click in the editor, and select Execute All.
From WorkSpace Navigator
  1. Select one or more SQL files.
  2. Right-click the files and choose Execute SQL File.
  3. If you selected multiple SQL files, click OK in the Select Profiles for the File dialog.
From the toolbar
  1. Click the "Choose a .sql File to Execute" 
						  Choose One or More SQL Files to Execute button on the Database Development perspective toolbar.
  2. On your file system, navigate to your workspace and project.
  3. Select the SQL files you want to execute from the file system, and click Open.
  4. Select the Database Server Type, Connection Profile Name, and Database Name.
  5. (Optional) If you did not create a connection profile for this database type, click Create.
  6. Click OK.

The SQL file executes, and results appear in the SQL Results view. SQL Results view displays the result sets, database server messages, execution status (success or failure) and operation details.

Related concepts
Run Overview
SQL Scrapbook
Related tasks
Creating a Launch Configuration for Routine Procedural Objects
Running a Stored Procedure
Running a Trigger
Running a User-Defined Function
Running a SQL Anywhere or Sybase IQ Event
Viewing SQL Results


Created June 25, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com