SSMS crashes when opening Design Query Editor

試著忘記壹切 提交于 2020-01-07 04:46:42

问题


is there a fix for the crash in SQL-Server 2005 Management Studio when you try to open a design-query-editor with a sql-statementent preceding USE database;?

For example:

USE DB1;
SELECT * FROM Table1;

If you mark SELECT * FROM Table1;, you can open the editor succesfully. If you mark both lines, SSMS will crash with a "Microsoft SQL Server Management Studio has stopped working"-Dialog(with the option to debug or close SSMS) and some additional information on this problem f.e.:

  Problem signature:
  Problem Event Name:   BEX
  Application Name: SqlWb.exe
  Application Version:  2005.90.5000.0
  Application Timestamp:    4d02772b
  Fault Module Name:    vdt80.dll
  Fault Module Version: 8.0.50727.1826
  Fault Module Timestamp:   480d6e41
  Exception Offset: 0032ae42
  Exception Code:   c0000409
  Exception Data:   00000000
  OS Version:   6.1.7601.2.1.0.16.7

SQL-Server version:

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
9.00.5000.00       SP4       Enterprise Edition (64-bit)

OS:

Windows Server 2008 R2 Standard(SP 1)

Edit: this problem also occurs if i try to open the designer with T-SQL Statement like:

IF EXISTS(
    SELECT *
    FROM ClosingDate
    WHERE DATEDIFF(DAY, DATEADD(DAY, -1, GETDATE()). ClosingDate) = 0
) UPDATE Table2 SET
    Column1 = 255
WHERE
    Column1 = 1

回答1:


sure, take out the use db statement and change the code to this:

select * from DB1.dbo.Table1

this syntax will allow you to select data from other databases on the same server in which you are not in the context of.



来源:https://stackoverflow.com/questions/5091742/ssms-crashes-when-opening-design-query-editor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!