SQL Server Object Explorer unable to edit DDL

I have been unable to retrieve and edit Table, Procedure, View, ... DDL using this tool.

When I check the "View Code", the Query window pops up with the "Retrieving Updated definition from the server" comment but that is it.  That comment is subsequently replaced by "/*

Could not retrieve the definition of [dbo].[InsertIntoMutualFundInfo] from the server

*/.

Will get the pop-up message that "Visual Studio is busy .. Contact MS if this occurs frequently" (paraphrased).

This is a Visual Studio 2015 Community.

Microsoft Visual Studio Community 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.6.00081

Installed Version: Community

Visual Basic 2015   00322-20000-00000-AA665
Microsoft Visual Basic 2015

Visual C# 2015   00322-20000-00000-AA665
Microsoft Visual C# 2015

Visual C++ 2015   00322-20000-00000-AA665
Microsoft Visual C++ 2015

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   14.0.20626.0
ASP.NET and Web Tools

ASP.NET Web Frameworks and Tools 2013   5.2.30624.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.5
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GenerateUnitTest   1.0
Generates unit test code for methods in classes under test.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.0.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.50616.0
Microsoft SQL Server Data Tools

The database is Microsoft SQL Azure (RTM) - 12.0.2000.8   Sep  1 2015 11:53:50   Copyright (c) Microsoft Corporation

The queries seem to be working and respond acceptably.

September 9th, 2015 10:44am

Hi TJH99,

Could not retrieve the definition of [dbo].[InsertIntoMutualFundInfo] from the server

Based on your description, you are using SQL Server Object Explorer in Visual Studio and getting the above error message when checking the "View Code".

This issue is related to account permission. To view code for an object, the minimum set of permissions required is VIEW DEFINITION on the entire database, it is not sufficient to have View Definition on one object. This is by design.

Reference:
https://social.msdn.microsoft.com/Forums/en-US/4db0ece6-968f-4a9e-918b-8ab765f340c0/view-designer-could-not-retrieve-the-definition-of-xy-from-the-server?forum=ssdt

https://connect.microsoft.com/VisualStudio/feedback/details/779978/vs-2012-cannot-view-stored-procedure-definition-using-sql-server-object-explorer

Thanks,
Lydia

Free Windows Admin Tool Kit Click here and download it now
September 9th, 2015 11:01pm

Did not work.  Issued "grant view definition on DATABASE::{db) to {user id} with grant option."

Sort of works in SSMS but not at all in VS.  I can generate ddl scripts out of SSMS but seems to take a long time.

Here is the sys.database_permissions entries:

class    class_desc    major_id    minor_id    grantee_principal_id    grantor_principal_id    type    permission_name
0    DATABASE    0    0    7    1    VW      VIEW DEFINITION
0    DATABASE    0    0    8    1    VW      VIEW DEFINITION
0    DATABASE    0    0    9    1    VW      VIEW DEFINITION

Other references to the database objects (e.g. Show data, ..) take a very long time.

September 10th, 2015 2:48am

Hi TJH99,

Since the issue is more related to SQL Server data tools, I would recommend you post the question in the SQL Server Data Tools forum to get better support.


Thanks,
Lydia Zhang

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 2:15am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics