SQL Server 2008 - 从选择到快速编辑

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/881900/
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 02:08:06  来源:igfitidea点击:

SQL Server 2008 - Go From Select to Edit Quickly

sqlsql-server-2008ssms

提问by Skiltz

In server management studio 2008 you can right mouse click on a table and then hit the select the first 1000 rows. Is there a button or a quick way to edit one of the returned rows instead of having to right mouse click on the table again and click edit first 200 rows.

在 server management studio 2008 中,您可以在表格上单击鼠标右键,然后点击选择前 1000 行。是否有按钮或快速方法来编辑返回的行之一,而不必再次右键单击表格并单击编辑前 200 行。

回答by Taylor K.

Here's the way I normally go about this:

这是我通常的处理方式:

  1. Right-Click table and select "Edit Top 200 Rows"

  2. Right-Click anywhere on the results, navigate to Pane -> SQL

  1. 右键单击表格并选择“编辑前 200 行”

  2. 右键单击结果中的任意位置,导航到 Pane -> SQL

You'll see a SELECT statement that begins with

你会看到一个以

SELECT TOP(200) .....

Change the "200" to a larger value, or add a WHERE clause at the bottom.

将“200”更改为更大的值,或在底部添加 WHERE 子句。

回答by CPU_BUSY

In Options - SQL Server Object Explorer, Commands you can edit the Values for the

在选项 - SQL Server 对象资源管理器中,您可以编辑

Edit Top Rows command

编辑顶行命令

Select Top Rows command

选择首行命令

You could change the edit to be 1000 rows instead of 200

您可以将编辑更改为 1000 行而不是 200

回答by willem

On my system I can click on edit top 200 rows immediately (no initial select first 1000 required).

在我的系统上,我可以立即单击编辑前 200 行(不需要初始选择前 1000 行)。

If you need to choose Whichrow, you can click on the SQL toolbar button to edit your query.

如果您需要选择哪一行,您可以单击 SQL 工具栏按钮来编辑您的查询。

回答by Bumble Bee

In SQL Server 2008 Management Studio, you may want to change the default settings to allow you to edit more than the 200 rows at a time, or select more than 1000 rows, which are the default settings for SQL Server.

在 SQL Server 2008 Management Studio 中,您可能希望更改默认设置以允许您一次编辑超过 200 行,或选择超过 1000 行,这是 SQL Server 的默认设置。

To modify "Edit Top 200 Rows" or "Select Top 1000 Rows" setttings do the following:

要修改“编辑前 200 行”或“选择前 1000 行”设置,请执行以下操作:

1.In SQL Server 2008 Management Studio, go to "Tools" -> "Options" -> "SQL Server Object Explorer" -> "Commands".

1.在 SQL Server 2008 Management Studio 中,转到“工具”->“选项”->“SQL Server 对象资源管理器”->“命令”。

2.Now in the right-hand side "Table and View Options" section, you can change either: ?Value for Edit TopRows command, to a value greater than or less than 200. ?Value for Select TopRows command, to a value greater than or less than 1000.

2.现在在右侧的“表和视图选项”部分,您可以更改: ? 编辑 TopRows 命令的值,为大于或小于 200 的值。 ? 选择 TopRows 命令的值,为更大的值小于或小于 1000。

3.By specifying a value of 0, SQL Server will return all rows. (If you sql tables are really large, you will definitely NOT want to set these values to 0.

3.通过指定值 0,SQL Server 将返回所有行。(如果您的 sql 表非常大,您肯定不想将这些值设置为 0。

4.Click OK to save your changes.

4. 单击确定保存更改。