I've found this reference article talking about how to query a file geodatabase using SQL.


My problem is that it doesn't provide any details of how to to connect SSMS (or other query tool) to the file. Is a driver required? Linked server?

Normally any queries about this result in me directed to ArcSDE. But his article suggests file Geodatabases can be queried by SQL.

  • File geodatabases support a subset of the SQL language. But "SQL" does not mean SQL-Server. It is NOT possible to connect to a file geodatabase through a Microsoft SQL client.
    – Vince
    May 28, 2015 at 23:07

2 Answers 2


As Vince mentioned, you cannot access Esri file geodatabase from SSMS or any other SQL client. File geodatabase is stored in a proprietary way and there is no SQL interface to access it with.

The help page you found refers to the methods that can be access programmatically with ArcObjects. You cannot supply this kind of query in the Select by Attributes window or in the Query Definition dialog box in ArcMap. Some kind of SQL operators can be executed with arcpy.da.SearchCursor in the sql_clause parameter (for data filtering and aggregating) when accessing file geodatabases.

If you wish to access your file geodatabase with a limited SQL interface, you would need to either use ArcObjects or use File Geodatabase API. Here is an example on How to execute a SQL query on a file geodatabase using the File GDB API for .NET.

  • File geodatabases are not "encrypted", just opaque. Even using the FGDB API, there is no provision for making it accessible to SSMS without significant reverse-engineering of Microsoft's SQL-Server server-side protocols.
    – Vince
    May 29, 2015 at 12:24
  • I need to protest the adjective "rich" as well. FGDB's SQL implementation is better at 1.4, but it's not "rich" - No views, no stored procedures, no use of the JOIN keyword, no UNION ALL, no spatial operators in SQL expressions... I'd recommend "limited SQL interface".
    – Vince
    May 29, 2015 at 14:40
  • @Vince, knowing how long you've been working with databases (btw, I was once a huge fan of your se_toolkit), I have happily edited my answer :) May 29, 2015 at 15:14

From a quick googling, it looks like there are 3rd party products that can query file geodatabases:

They might be a good alternatives to SSMS.

Also, file geodatabases now support database views via the Create Database View (Data Management) geoprocessing tool.

Related: Idea: Driver for connecting to FGDBs using an SQL client (such as JDBC)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.