如何在 SQL Server Management Studio 中快速编辑表中的值?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1535469/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 03:55:44  来源:igfitidea点击:

How to quickly edit values in table in SQL Server Management Studio?

sqlsql-serverssms

提问by Xerion

Aside from context menu -> "Edit Top 200 Rows" from Object Explorer, is there a quick way to open a table in Edit mode where I can just quickly modify the value of a cell?

除了上下文菜单 -> 对象资源管理器中的“编辑前 200 行”之外,是否有一种快速方法可以在编辑模式下打开表格,我可以在其中快速修改单元格的值?

I need to be able to page past the first 200 rows. And I dont want to write "insert" script for every minor tweak I need to do... I don't understand why SMS doesn't offer quick access to a paged table editor (like Navicat).

我需要能够翻过前 200 行。而且我不想为我需要做的每个小调整编写“插入”脚本......我不明白为什么 SMS 不提供对分页表编辑器(如 Navicat)的快速访问。

回答by brendan

In Mgmt Studio, when you are editing the top 200, you can view the SQL pane - either by right clicking in the grid and choosing Pane->SQL or by the button in the upper left. This will allow you to write a custom query to drill down to the row(s) you want to edit.

在 Mgmt Studio 中,当您编辑前 200 个时,您可以查看 SQL 窗格 - 通过在网格中右键单击并选择 Pane->SQL 或通过左上角的按钮。这将允许您编写自定义查询以深入到要编辑的行。

But ultimately mgmt studio isn't a data entry/update tool which is why this is a little cumbersome.

但最终 mgmt studio 不是数据输入/更新工具,这就是为什么这有点麻烦。

回答by Adam Maras

Go to Tools > Options. In the tree on the left, select SQL Server Object Explorer. Set the option "Value for Edit Top Rows command" to 0. It'll now allow you to view and edit the entire table from the context menu.

转到工具 > 选项。在左侧的树中,选择 SQL Server 对象资源管理器。将选项“Edit Top Rows 命令的值”设置为 0。它现在允许您从上下文菜单中查看和编辑整个表格。

回答by Paul

Brendan is correct. You can edit the Select command to edit a filtered list of records. For instance "WHERE dept_no = 200".

布兰登是对的。您可以编辑“选择”命令来编辑过滤的记录列表。例如"WHERE dept_no = 200"