You can create SQL script files that contain procedures that you frequently run against databases, as well as scripts to create database objects. An SQL script file, similar to a stored procedure, is a text file containing commands to be executed. SQL scripts are useful for database administrators who need to track the changes made to a database.
The Project Explorer provides a graphical means of managing your SQL scripts. By double-clicking, dragging and dropping, and using the right-click features, you can open, create, edit, and execute your queries.
Note For details about using the Microsoft® Visual Database Tools with database projects, see Working with Database Projects.
SQL script files are saved with your database project on your local computer instead of residing on the database server, like a stored procedure. You can add an SQL script file into multiple database projects and run it against multiple databases.
To | See |
Create a new SQL script and add it to a project | Creating SQL Scripts |
Automatically generate an SQL change script showing all changes made to the database | Saving a Change Script |
Run an SQL script | Executing an SQL Script |
Create an SQL script file in different SQL dialects, including Microsoft® SQL Server™ Transact-SQL and Oracle SQL+ | Changing the SQL Dialect of an SQL Script |