---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Configure SQL Server

# Configure SQL Server {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read

The following example configuration was performed on SQL Server 2008, installed on
Windows Server 2008.

## Before you begin

The ODBC driver must be installed on the same computer on which SQL Server is installed.

## Procedure

1. Right-click the SQL Server Management Studio application and select Run as Administrator.
2. Log in to the database to which you want to link.
3. Right-click Server ObjectsLinked Servers.
4. Click New Linked Server.
5. Enter the following values in the dialog.  
   * Linked server: <kbd class="ph userinput">SERVICENOW</kbd>. This is the name of the Linked Server.
   * Provider: <kbd class="ph userinput">Microsoft OLE DB Provider for ODBC drivers</kbd>
   * Product name: <kbd class="ph userinput">ServiceNow</kbd>. This is an identifier. Enter any value that is appropriate.
   * Data source: <kbd class="ph userinput">ServiceNow</kbd>. This is the name of your DSN.

   {#t_ConfiguringSQLServer__ul_sbb_42d_np}  
6. Select Security from the Select a page list, and then enter the following security values:  
   1. For a login connection, select Be made using this security context.
   2. Enter the user name and password for connecting to the ServiceNow instance.
   3. Click OK.

   {#t_ConfiguringSQLServer__ol_pks_w2d_np}  
7. Navigate to Server ObjectsLinked ServerProviders and double-click Microsoft OLE DB Provider for ODBC drivers.
8. Select the following options.  
   * Nested Queries
   * Level zero only
   * Support 'Like' operator

   {#t_ConfiguringSQLServer__ul_m1t_lfd_np}  
   Tip:  
   ServiceNow
   recommends running the third-party provider in the out-of-process mode
   setting (AllowInProcess=FALSE). If you run the provider
   in-process (within the same process as SQL Server), then any issues with
   the provider can affect the SQL Server process, which in turn could
   result in crashing SQL server.  
9. Test your connection by selecting the newly created linked server SERVICENOW and selecting Test connection.
10. Execute the following query in a query builder window to retrieve some results.  

## What to do next

Number Precision Errors  
You may encounter precision errors querying for decimal or number field values using the OPENQUERY syntax with the ODBC driver. In this case, use the Cast syntax to convert the precision. For example:

    SELECT * FROM OPENQUERY (SERVICENOW , 'select Cast(sys_mod_count as Decimal(38,0)), number, short_description from incident' ) GO

SQL
Server Connection String  
To use the ODBC driver directly in SQL Server 2008, specify the connection string in the following format.

    Dsn=ServiceNow;uid =username;pwd =password

Note:  
The latest SQL Server 2008 patches are required for the ability to specify a connection string in the user interface, via the SQL import wizard

Using sp_addlinkedserver  
The following example creates a linked server named "ServiceNow ODBC" that uses the Microsoft OLE DB Provider for ODBC (MSDASQL) and the data_source parameter

    EXEC sp_addlinkedserver 
       @server  = N 'ServiceNow ODBC' , 
       @srvproduct  = N '' ,
       @provider  = N 'MSDASQL' , 
       @datasrc  = N 'ServiceNow';
     GO

After
creating the linked server, you must update its properties to specify the login
credentials.

*[\>]: and then


