How to: Save a Query or Script

After you change a Transact-SQL (T-SQL) query or script in the T-SQL editor, you must save your changes. Saving changes to a query or script is no different from saving changes to any other text, code, or XML file.

To save changes to a query or script

  1. On the File menu, click Save FileName.

    Note

    You can also use SaveFileNameAs to save the script or query with a new name or in a new location.

  2. If you edited a file that was under version control without checking it out and if you changed the Visual Studio default so that it prompts you to check out files, you are prompted to check the file out. Click Yes to check out the file and save your changes.

    Your file is saved to disk, and the asterisk on the document window disappears, no longer indicating that the file had been modified since the last time that you saved it.

See Also

Tasks

Walkthrough: Create and Execute a Simple Transact-SQL Script

Other Resources

Transact-SQL Editing Essentials
Script Analysis and Execution in the Transact-SQL Editor