是否可以手动打开编辑窗口,类似于 Sql Server Management Studio 中的“编辑前 200 行”选项?
这个屏幕在开发中非常有用。有没有一种方法可以让所有查询窗口都像这个一样?它看起来很特殊,并且仅当您选择“编辑前 200 行”选项时才会被调用。
This screen is so useful in development. Is there a way to have all query windows behave like this one? It seems special and is only invoked if you select the "Edit Top 200 Rows" option.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以这种方式在 SQL Server 中编辑数据是一个非常糟糕的想法™。这可能更容易,但会导致一致性和/或无效/错误数据的问题。如果将所有插入放入脚本中,您就可以进行数据的版本控制和可复制性。如果您对所有内容进行临时密钥,则可能会丢失所有数据而无法按原样重新制作。
It's a REALLY TERRIBLE IDEA™ to edit data in SQL Server this way. It may be easier, but it will leas to issues with consistency and/or invalid/miskeyed data. If you put all your inserts into scripts, you have version control and duplicability of your data. If you ad-hoc key everything, you are likely to lose all your data without being able to remake it as it was.
我不知道是否有办法使查询窗口的行为类似于“编辑”窗口,但是有一种方法可以使“编辑”窗口的行为类似于查询窗口(并且可能实现您想要的):
我是猜测您为什么要这样做...但假设您想这样做,以便可以将记录过滤到整个表的子集:打开“编辑前 200 行”窗口后,您可以单击“SQL”工具栏按钮(“Show SQL Pane”),它将公开 SQL 查询。然后,您可以修改查询(例如,添加 where 子句),以便您可以筛选出仅要编辑的记录。
当然,如果您手动编辑数据,请小心这一点(出于 JNK 提到的所有原因)。
I don't know if there's a way to make a query window behave like the "Edit" window, but there's a way to make the "Edit" window behave like a query window (and possibly achieving what you want):
I'm guessing at why you want to do this... but say for example you want to do this so that you can filter records down to a subset of the whole table: Once you've opened the "Edit Top 200 Rows" window, you can click on the "SQL" toolbar button ("Show SQL Pane"), and it will expose the SQL query. You can then modify the query (eg. add a where clause) so that you can filter down to only the records that you want to edit.
Of course, be careful with this (for all the reasons JNK mentioned) if you're editting the data manually.