Visual studio code 从游标位置执行SQL语句,而无需在PowerShell中选择类似F8的选项
我正在使用带有ms sql扩展名的VSCode 我希望执行sql语句而不选择它。所以我有乙二醇Visual studio code 从游标位置执行SQL语句,而无需在PowerShell中选择类似F8的选项,visual-studio-code,Visual Studio Code,我正在使用带有ms sql扩展名的VSCode 我希望执行sql语句而不选择它。所以我有乙二醇 Select that from this go select more fro|m there where valid = 1 go 光标位于位置“|”,如果我按了一个特定的键(如PowerShell中的F8),它将执行第二条SQL语句。光标位置可以在代码中的任何位置。 无论如何,这行得通吗 因为我被否决了,我想,也许这比想象的要容易。是的,有一个现成的命令。只需将以下内容添加到key
Select that from
this
go
select more
fro|m there
where valid = 1
go
光标位于位置“|”,如果我按了一个特定的键(如PowerShell中的F8),它将执行第二条SQL语句。光标位置可以在代码中的任何位置。
无论如何,这行得通吗 因为我被否决了,我想,也许这比想象的要容易。是的,有一个现成的命令。只需将以下内容添加到keybindings.json中即可工作:
{
"key": "f8",
"command": "mssql.runCurrentStatement",
"when": "editorTextFocus && editorLangId == 'sql'"
}