We have extended our Early Bird Tickets for Inspire 2023! Discounted pricing goes until February 24th. Save your spot!

Alteryx Designer Knowledge Base

Definitive answers from Designer experts.

How To: Connect to an ODBC Data Source

AliS
Alteryx Alumni (Retired)
Created

How To: Connect to an ODBC Data Source

Alteryx can connect to databases using different methods. This guide will focus on setting up an ODBC connection to SQL server, however, the same general process can be followed to connect to any database via ODBC.
 

Prerequisites

  • Alteryx Designer or Server.
  • ODBC driver for the database (if it is not currently present on your machine, you must download and install it prior to using this guide. The download links to many of the drivers can be found here. If you are unsure of where to get the driver or which driver to use, please contact your IT or database admin for this information). For Designer 2021.3+, a supported 64-bit driver is required; see also here.


User and System DSN (Data Source Name)
Before proceeding, it is important to decide whether to use a System or a User DSN. A DSN is a symbolic name that represents the ODBC connection. It stores connection details like database name, directory, User ID, password etc. and is utilized when making a connection to an ODBC data source. Please refer to this Microsoft article for further information.

There are various types of ODBC data source types.

  1. The System DSN is available for all users on the system. To create it, administrative privileges are required on the Windows OS. Often the customer's IT has to be involved in creating a System DSN. The typical use case would be sharing a data connection inside the organization. For a data connection to use a DSN on Server, it needs to be created as a System DSN.
  2. The User DSN on the other hand is created for a specific user. Only the user who created the DSN can use it.

Both types of DSNs can be configured via the ODBC Admin app.

image.png

Please note that Alteryx Designer / Server do not support File DSNs.

2019.2 and later

  • Open Alteryx Designer and drag and drop the “Input Data” tool onto the canvas
  • Click the drop-down  "Connect to a File or Database."

ole1.png

  • The Single Access Point data connections dialogue will open up. Choose the relevant data connection and select ODBC.

idea Skyscrapers

 

Before 2019.2

  • Click the drop-down to "Connect to a File or Database." Then select "Database Connection" > "New ODBC Connection…" The "Data Link Properties" window should appear.
  • odbc1.png
  • Click the dropdown to “Connect to a File or Database.” Then select “Database Connection”->”New ODBC Connection…” The ODBC connection window should appear

ODBC2.png

 

All Versions

  • A new window ODBC Connections will open

idea Skyscrapers

  • Click the “ODBC Admin” button to go to the Windows ODBC Administrator app to set-up the connection.
idea Skyscrapers
  • In the ODBC Data Source Administrator, click the “Add…” button to set-up the new connection. You will have the choice between adding a new Data Source using a User DSN or System DSN, see this KB article  for more details on the difference.
  • You will be directed to a window to choose the driver to use for the connection.
  • Select the driver and click “Finish”

idea Skyscrapers

  • Select a name for this connection
  • Click the dropdown to find the SQL server you wish to connect to or type in the server name
  • Click “Next”

idea Skyscrapers

  • On the next screen, choose which type of authentication you will be using:
    • You can choose between Integrated Windows authentication, Integrated Active Directory Authentication or login ID
  • Choosing Windows Authentication and Active Directory Integration requires no additional information as the user ID you are logged in to windows as will be recognized
  • Using login ID authentication will require you to enter the user ID and password. 
  • The DBA or IT will be able with further details on the above settings
  • Once you’ve chosen your login method, click the “Next” button

idea Skyscrapers

  • Click “Next” through the menu screens. Change any optional settings via the menus if you wish to adjust them. Generally the default configuration should provide a successful connection, however in case of doubt feel free to check with your DBA.
  • After clicking the “Finish” button, click the "Test Data Source..." button
  • If the “TESTS COMPLETED SUCCESSFULLY!” dialogue appears, you have successfully set up your connection
  • Click “OK” twice to exit the connection wizard
  • Click “OK” to exit the ODBC administrator

idea Skyscrapers

  • In the alteryx ODBC connection window, select the Data Source Name you’ve just created. Enter a username and password if required (optional) and push “OK”

idea Skyscrapers

 

  • The Choose Table or Specify Query window should pop up. If there are tables already in the database, select a table and push “OK”.

odbc10.png

2019.2 and later
  • Upon successful connection, the ODBC connection will now appear under "recent"
idea Skyscrapers

Before 2019.2
  • Upon successful connection, the ODBC connection will now be stored in the “Input Data” tool’s initial dropdown

odbc11.png​​​​​​​



 

Comments
rohit782192
10 - Fireball

Hello Team,

 

Can you provide me a details on how we connect ODBC to Oracle.

The Example provide is of Microsoft SQL Server.

I want to connect to ODBC with Oracle (64 Bit)

 

Thanks in Advance.

napplewh
8 - Asteroid

I am having many issues connecting to ODBC data sources.

 

Any advice? 

rohit782192
10 - Fireball

I am not getting ODBC 64 bit driver.

srikantap
5 - Atom

Well explained.

tothd
7 - Meteor

 

olimpio
8 - Asteroid

Hi, I am a new user with Alteryx and needed some advice on connecting to Hive tables is Hadoop.

 

it would be great if I could get some information on how do I start, thanks

 

LisaL
Alteryx
Alteryx

@olimpio 
Your go-to resources on how to connect to databases is this list of Data Sources and the help for Input Data tool.  Many of the Data Sources have articles in Community, and Hadoop is no exception.  If you're new to Alteryx this article on how to search Community might be helpful to you.

danishimam
7 - Meteor

Hello,

 

Im trying to connect with mysql and was able to download and install odbc driver for mysql and created odbc data source successfully.

In alteryx also i was able to use Input Tool to connect using the above odbc data source and get the list of tables in "Visual Query Builder", but when i switched to "SQL Editor" to test the query it giving below error "No Columns Returned" although there are data in the table.

 

did anyone got this issue ? help requested.

 

danishimam_0-1617898419412.png

 

Thank you,

Danish

nbrenner
7 - Meteor

@danishimam , Are you trying to connect to system tables/resources?  I have found even in SQL Server ODBC not all objects are available.  i.e. I cannot access system stored procedures to get user lists from the db, only application built procedures are available, nothing from the System Stored Procedures objects. 

So, even if you have access from testing in other tools, if you type the command in SQL Editor box to access them, Alteryx just responds with No Columns Returned as it cannot find the objects.  Note in the visual query builder whether or not you can see them.

danishimam
7 - Meteor

@nbrenner, i was trying to connect to system table. I was doing this for one of the POC but we didnt went that path and so no longer needed solution. but not sure why alteryx is behaving that way 😔

nbrenner
7 - Meteor

In case it is needed again by anyone in the future, I am informed that sys stored procedures are not returned within Alteryx by design, but there is a workaround.  If you add in the metadata (column names, etc) expected to be returned to the SQL statement in the editor it should work - it did for me!  See below for an example capturing the data for sys.sp_helpuser from MS SQL Server.

 

There is a known defect (TDCB-3694): sometime when using ODBC connection the Stored Procedure throws "No Columns Returned" error, but OLEDB does not. 
Refer this Knowledge Base article .
Defect TDCB-3694 is still open. I have linked this case to the defect. We will notify you of any updates we receive from our development team. 
The workaround is to add the metadata at the end of the stored procedure defining the result set when calling the stored procedure.

 
I tested the workaround using using ODBC connection and system stored procedure sys.sp_helpuser with below statement and it works:

EXEC sys.sp_helpuser
with result sets (
(UserName sysname,
RoleName sysname,
LoginName sysname,
DefDBName sysname,
DefSchemaName sysname, 
UserID     smallint,
SID smallint)
);

Please apply that workaround. 

 

Thanks to Nora Tobon from the support team on assisting with my ticket!