Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register Now!

Qlik Sense Enterprise on Windows: Execute SQL Set statements or Non Select Queries

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
NadiaB
Support
Support

Qlik Sense Enterprise on Windows: Execute SQL Set statements or Non Select Queries

Last Update:

Jan 12, 2026 6:51:16 AM

Updated By:

Sonja_Bauernfeind

Created date:

May 27, 2022 11:08:55 AM

In order to include SQL SET statements or non select queries in the script, depending of the driver configurations might be needed. The following is a basic sample that shows how to include SQL SET statements or non-select queries using the Qlik ODBC Package and the native SQL Native Driver.

Environment

  • Qlik Sense all versions.

Qlik ODBC Package

a SET statement is considered a non select query, therefore it needs to be enabled, setting allow-nonselect-queries to true (see instructions here)

in addition it will be necessary to include  !EXECUTE_NON_SELECT_QUERY in the query 

Option 1

Simple query 

SQL SET ANSI_NULLS ON !EXECUTE_NON_SELECT_QUERY;
SQL SET NOCOUNT ON !EXECUTE_NON_SELECT_QUERY;
SELECT * FROM
master.sys.syslanguages;

Option 2

If you get syntax errors you can attempt to use a variable

vSQLScript = 'SET NOCOUNT ON !EXECUTE_NON_SELECT_QUERY;
SELECT * FROM
master.sys.syslanguages;';

SQL $(vSQLScript);

Option 3

If none of the above suggestions worked you might need to use a DB object as a workaround (store procedure, views, etc), this is a sample with an Store Procedure: 

SQL EXEC sp_databases;

SQL Native Driver

The driver can be downloaded from Microsoft, make sure is up to date and compatible with your SQL Server DB (ODBC Driver for SQL Server)

Option 1

Simple query 

SQL SET NOCOUNT ON ;
SELECT * FROM
master.sys.syslanguages;

Option 2

If you get syntax errors you can attempt to use a variable

vSQLScript = 'SET NOCOUNT ON ;
SELECT * FROM
master.sys.syslanguages;';

SQL $(vSQLScript);

Option 3

If none of the above suggestions worked you might need to use a DB object as a workaround (store procedure, views, etc), this is a sample with an Store Procedure: 

SQL EXEC sp_databases;

 

Labels (1)
Version history
Last update:
3 weeks ago
Updated by: