5.18. SQL Server Connector
To configure the SQL Server connector, create a catalog properties filein named, for example, sqlserver.properties
, tomount the SQL Server connector as the sqlserver
catalog.Create the file with the following contents, replacing theconnection properties as appropriate for your setup:
The SQL Server connector can only access a single database withina SQL Server server. Thus, if you have multiple SQL Server databases,or want to connect to multiple instances of the SQL Server, you must configuremultiple catalogs, one for each instance.
To add another catalog, simply add another properties file to etc/catalog
with a different name (making sure it ends in .properties
). For example,if you name the property file sales.properties
, Presto will create acatalog named sales
using the configured connector.
You can see the available schemas by running SHOW SCHEMAS
:
If you have a schema named web
, you can view the tablesin this schema by running :
You can see a list of the columns in the clicks
table in the web
databaseusing either of the following:
If you used a different name for your catalog properties file, usethat catalog name instead of sqlserver
in the above examples.
Presto supports connecting to SQL Server 2016, SQL Server 2014, SQL Server 2012and Azure SQL Database.
Presto supports the following SQL Server data types.The following table shows the mappings between SQL Server and Presto data types.
The following SQL statements are not yet supported:
- DELETE
- (CREATE TABLE AS is supported)