If you do not want to list the system views and catalog views in the Query Wizard, you can use one of the following methods:
Method 1:Instead of using the Microsoft Excel option [Data -> Get External Data -> From Other Sources -> From
Microsoft Query] use one of the following methods to import data into the worksheet:
- [Data -> Get External Data -> From Other Sources -> From Data Connection Wizard]
- [Data -> Get External Data -> From Other Sources -> From SQL Server]
The Data Connection Wizard and the SQL Server option uses OLEDB provider to connect to SQL Server instead of ODBC DSN. Apart from this, these wizards automatically filter out the system views and catalog views and list only the user tables and views, as show in the screenshot below:
Method 2: Configure Microsoft Query to show only user tables. You can use the OPTIONS available in the Query Wizard to customize the type of objects that are listed. If you uncheck the VIEWS option, then the “Available tables and columns” section will list only the user tables. This is a one-time change and the selection is saved for this user until the user changes it back again. You do not need to make this change every time you launch Microsoft Excel.
Method 3: Configure Microsoft Query to show only user tables and views that belong to a specific schema (for example:
dbo). You can use the OPTIONS available in the Query Wizard to customize the owner of objects that are listed. If you select "dbo" as owner, then the
Available tables and columns section will list only the user tables and views that are created under the "dbo" schema.
Method 4: Use Windows registry to control the objects that are displayed by the Query wizard.
Note: The registry key and the associated sub keys will only be created on your system after you run through the Query Wizard at least once on that system.
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base: 322756 How to back up and restore the registry in Windows
- Open the registry editor using Regedit and navigate to the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Query\Table Options - Modify the Tables value to 1.
The registry key may have values similar to the following after the above change:
"Views"=dword:00000000
"Tables"=dword:00000001
"Synonyms"=dword:00000001
"SysTables"=dword:00000000
"AlphabeticalItemOrder"=dword:00000001 Note: The number 14.0 in the path shown above will change depending upon the version of Microsoft Excel you have on your system.
Once you setup the Table options, the Query Wizard will list only the user tables.
