Pre-General Availability: 2023-05-24
To edit a new SQL script, TS script, or JS script:
Open the database connection or select an open connection from the Editor list of the toolbar.
From the connection's toolbar, click the file-list icon and select
New SQL Script,
New TS Script, or
New JS Script.
By default, the first editor to open in the connection tab is the notebook-interface-style editor. It is possible to reset this behavior by changing the following extension settings:
Msg › Db Editor:Default Editor setting value to
Msg › Db Editor:Start Language setting value to your preferred scripting language.
To edit an existing SQL script, TS script, or JS script:
Navigate to the script file by selecting the Explorer icon from the activity bar (Ctrl+Shift+E).Note
Visual Studio Code might prompt you to set up a folder first.
Right-click the file and select.
When prompted, select a connection for SQL execution. The file opens in the connection tab and the file name appears in the Editor list of the connection's toolbar.
Script editors have many of the same editing features as notebook editors do, although open script files do not facilitate multiple code blocks. Instead, all script editors support standard files that provide line numbers.
The toolbar and the result set capabilities for the script interface are nearly identical to the notebook interface. The following figure shows an open script after it is executed. In this example, the tool generates multiple tabs to display the output and results of the script. You can continue to edit your script after you have executed it.