0
  • SQL Server 2008
  • Visio Pro 2003
  • Access 2003
  • System DSN used

I need to reverse engineer a SQL Server db, however the 'Views' box is "greyed out" when I attempt to do so (stored procedues are also "greyed out" but unecessary for my needs at this stage). I am using a SQL Server account that has sys_admin rights to connect via ODBC (ODBC needs to be used because Visio won't recognise the native connector, a well documented deficiency, and a trusted connection can't be used as I also have local admin rights and our company refuses to recognise local admins on cross machine connections). This is using the ODBC SQL Server type of connection. If I change the ODBC connection to use the native client type it allows me to select the stored procedures, unfortunately the views box is still not able to be selected.

I connected with Access using the plain SQL Server type of ODBC to see what I would be able to link and it allows me to see all tables, views, including system tables and views, which tells me the sys_admin rights are being preserved through the ODBC connection.

Am I missing something here? A number of searches on SO and Google have turned up nothing about why Visio can't see certain objects (disregarding security permissions as I have admin access), and being able to "see" them via Access has made me a bit more frustrated, as I would assume both products utilising an ODBC connection of the same type would encounter the same restrictions and functionality.

How do I get Visio to let me use the "Reverse Engineer" functionality to put the views from the SQL Server into my Visio document? I've done this before with other servers in the past.

4

3 回答 3

1

I have created several new views in a SQL database and was unable to see them when attempting to link to them via Access. It always comes down to the fact that I have not given the user "Select" permission to either the SQL Database or the view. Be sure to check this. Just my 2 cents worth.

于 2013-09-26T14:56:41.723 回答
0

tl;dr

Don't use the OBDC driver, use the Access Visio driver.

Why?

As found here on SO:

An old thread but still a current problem ... I found that although using the ODBC Generic Driver worked, the reverse engineering tool then misses out Triggers, Check Clauses, Views and Stored Procedures. By specifying the Access Visio Driver instead, at least we recover the Check Clauses and Views.

In general, though, I have to say I think this shows an appalling lack of regard for their customers on behalf of the relevant teams at Microsoft. I had a very similar experience last year when upgrading to Visual Studio 2010 only to discover that my SSIS projects no longer opened ... as can be seen from this thread, MS could not care less.

于 2016-09-13T01:26:06.843 回答
-1

There is really no reason to assume that a reverse engineering tool that's capable of documentation or diagraming the relationships between tables has anything to do with the fact that you have some saved queries? A view is only some saved SQL query and has NOTHING at all to do with relationships between tables.

A saved SQL query (aka a view) is NOT a table design structure. The creation of a view or the deletion of a view has NO BEARING WHATSOEVER IN ANY MATERIAL WAY in terms of the database structures and relationships you build in a database.

As a result the reason why with an conservative estimate of 1 trillion web pages in existence a Google or Bing search results in ABSOLUTELY NO RESULTS for your question.

In other words your assumption that a database ER diagram is to include a bunch of saved SQL queries is a complete and utter fallacy on your part.

Now you might be asking if such a documentation tool exists, but you actually asked WHY you cannot find any information on this subject and the simple answer is because nobody else on the planet and in fact as far as we know in the galaxy makes the assumption you're making.

being able to "see" them via Access has made me a bit more frustrated.

And it's not clear why you show even more confusion by asking why you can utilize such views in an application development tool such as MS Access?

The simple answer as to why you can see these views using Access is because Access is not a reverse engineering tool. In fact Access is also not a database documentation tool either.

Access is a software development tool that allows you to build applications and CONNECT TO A GIVEN DATABASE SYSTEM. Thus MS Access can use a database such as the native database engine that ships with the product (JET or now called ACE). Access can also connect to Oracle, or something like SQL server.

In ALL these cases without a doubt Access can connect to a SQL view since the tool is designed to CONSUME data from the particular database engine. However consuming data from a particular database system is a MASSIVE AND SPECTACULARLY DIFFERENT PROCESS then using a reverse engineering tool to ascertain the relationships between tables.

The fact that a database system has some relationships between tables, or you have enforced relationships that you wish to diagram has absolutely nothing to do with the process of having something document a bunch of simple SQL queries saved in some place. So all a view really is some saved SQL. You can save SQL in code, in text files, or in the case of Access in with what we called a select query, or in the case of SQL server you can save SQL as views.

However, looking at a bunch of saved SQL queries is an entirely different matter then documentation the existence of relationships between tables in a database. Creating views, delete views has ZERO bearing on those relationships between tables.

In fact we see that MS Access table diagram tool does not have the ability to include views in the table relationships diagraming tool included with the product. So in fact MOST development tools do NOT include views in the overall table ER diagram.

So at the end of the day the likely reason why something like Visio cannot simply consume and utilize a bunch is saved SQL queries is that by design such a tool is not intended for that purpose at all.

于 2012-11-19T20:36:32.810 回答