Visual Studio SQL Server design and inline editing

2019-06-20 11:32发布

In Visual Studio 2012 I have two database connections configured in the Server Explorer. One is for a SQL Server 2008 R2 database, the other is for a SQL Server 2012 database. I've always been able to make quick inline edits to the data with SQL 2008 databases by right clicking on the table and selecting "Show Table Data".

Show Table Data command

I could then pop open the SQL pane and query the data, put a cursor directly in the field and edit the data in the result set. I relied on this method heavily when making quick edits to the data without the need to script.

Inline editing of data

It seems this option is not available for SQL Server 2012 connections. When I try to do the same it seems to open in the context of SQL Server Database Tools (SSDT). I will see an initial result set of 1000 records but unlike SQL 2008 no way simple way to run a more precise SELECT query and edit data inline by selecting and overwriting values in the result set. The screenshot below is the closest I can get by directly opening the new query window, but still no way to inline edit the results.

SSDT Window with no way to edit

Is it possible to get the 2012 database to behave like the 2008 database in Visual Studio? Did I miss a component on the installation of SQL 2012 that is preventing this behaviour? Or has Microsofts pulled these features away? I desperately want to get inline editing back, I don't want to have to write UPDATE queries to correct single lines of data, it's slower and it seems riskier.. if a clause is inadvertently missed it could end up corrupting a lot of data?

Any thoughts would be much appreciated.

1条回答
仙女界的扛把子
2楼-- · 2019-06-20 11:40

First, clear the query limits in the settings. This is under Tools menu, then Options, and scroll to "SQL Server Object Explorer" and "Commands"

Then, right click the table and click "Edit All Rows"

Then show the SQL pane and you can then edit the query. It is the icon that has the letters SQL in a square background. Not the icon with SQL on top of a cylinder.

I'd post pictures, but I don't have enough points, ridiculously. So sorry me. Message me if you want them.

查看更多
登录 后发表回答