Create Command File Dialog Box
Use this dialog box to create a command file that runs selected SQL scripts. You can create a new command file by adding multiple scripts from existing script files. The completed command file will execute all of the selected scripts. Command files are especially useful for managing database tables and reconstructing test data.
Note The Create Command File shortcut menu is only available for a database project.
To access this dialog box, right-click the project node or any child nodes containing scripts in Solution Explorer and then choose Create Command File on the shortcut menu.
- Name of Command File
- Specifies the name of the new command file. Visual Studio automatically appends a file extension of .cmd to the file name you supply. The new command file is saved in the selected project or child folder.
- Windows NT integrated authentication
- Select this to use the security and user-authorization mechanisms provided with Windows NT.
- SQL Server authentication
- Select this to use the security and user-authorization mechanisms provided with SQL Server.
- Available Scripts
- Lists the current create scripts and change scripts that are contained in the selected folder.
- Scripts to be added to the command file
- Lists the scripts you have already added to the command file.
- Adds one or more scripts to the command file. Make a selection in the list of available change scripts and create scripts and then click Add.
- Add All
- Adds all of the listed scripts to the command file. If you have already added a few script selections, this command adds all of the remaining scripts to the command file.
- Removes selected scripts from the command file. Make a selection in the list of scripts to be added to the command file and click Remove.
- Remove All
- Removes all of the scripts from the command file. If you have already removed a few scripts, this command removes all of the remaining scripts from the command file.
- Add Data
- Adds data files (for populating the tables) to the command file. To add data to your command file, select at least one .tab script file in the Available Scripts list, and click Add Data. The Add Data dialog box displays with a list of table files and associated data files. Click OK to accept the data files, and then click OK again to finally create the command file.
The Add Data button requires the existence of .tab files (definitions of tables) and .dat files (containing table data) in the database project. You can add .tab files to your database project by using the Generate Create Script command. You can add .dat files to your database project by using the Export Data command.