<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Qlik Sense Enterprise on Windows: Execute SQL Set statements or Non Select Queries in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Sense-Enterprise-on-Windows-Execute-SQL-Set-statements-or/ta-p/1936627</link>
    <description>&lt;P&gt;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.&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Environment&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;Qlik Sense all versions.&lt;/LI&gt;
&lt;/UL&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Qlik ODBC Package&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;a SET statement is considered a non select query, therefore it needs to be enabled, setting&amp;nbsp;&lt;SPAN class="statement"&gt;allow-nonselect-queries&lt;/SPAN&gt;&amp;nbsp;to&amp;nbsp;&lt;SPAN class="script_token"&gt;true (see instructions &lt;A href="https://help.qlik.com/en-US/connectors/Subsystems/ODBC_connector_help/Content/Connectors_ODBC/How-to-load-without-SELECT.htm" target="_self"&gt;here)&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;in addition it will be necessary to include&amp;nbsp; !EXECUTE_NON_SELECT_QUERY in the query&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Option 1 &lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Simple query&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;SQL SET ANSI_NULLS ON !EXECUTE_NON_SELECT_QUERY;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;SQL SET NOCOUNT ON !EXECUTE_NON_SELECT_QUERY;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;SELECT * FROM &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;master.sys.syslanguages;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;H4&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Option 2 &lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;If you get syntax&amp;nbsp;errors you can attempt to use a variable&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;vSQLScript = 'SET NOCOUNT ON !EXECUTE_NON_SELECT_QUERY;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;SELECT * FROM &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;master.sys.syslanguages;';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;SQL $(vSQLScript);&lt;/FONT&gt;&lt;/PRE&gt;
&lt;H4&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Option 3&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;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:&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;SQL EXEC sp_databases;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;H3&gt;&lt;FONT face="arial, helvetica, sans-serif"&gt;SQL Native Driver&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif"&gt;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)&lt;/FONT&gt;&lt;/P&gt;
&lt;H4&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Option 1 &lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Simple query&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;SQL SET NOCOUNT ON ;&lt;BR /&gt;SELECT * FROM &lt;BR /&gt;master.sys.syslanguages;&lt;/PRE&gt;
&lt;H4&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Option 2 &lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;If you get syntax&amp;nbsp;errors you can attempt to use a variable&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;vSQLScript = 'SET NOCOUNT ON ;&lt;BR /&gt;SELECT * FROM &lt;BR /&gt;master.sys.syslanguages;';&lt;BR /&gt;&lt;BR /&gt;SQL $(vSQLScript);&lt;/PRE&gt;
&lt;H4&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Option 3&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;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:&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;SQL EXEC sp_databases;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jan 2026 11:51:16 GMT</pubDate>
    <dc:creator>NadiaB</dc:creator>
    <dc:date>2026-01-12T11:51:16Z</dc:date>
    <item>
      <title>Qlik Sense Enterprise on Windows: Execute SQL Set statements or Non Select Queries</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Sense-Enterprise-on-Windows-Execute-SQL-Set-statements-or/ta-p/1936627</link>
      <description>&lt;P&gt;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.&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Environment&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;Qlik Sense all versions.&lt;/LI&gt;
&lt;/UL&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Qlik ODBC Package&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P&gt;a SET statement is considered a non select query, therefore it needs to be enabled, setting&amp;nbsp;&lt;SPAN class="statement"&gt;allow-nonselect-queries&lt;/SPAN&gt;&amp;nbsp;to&amp;nbsp;&lt;SPAN class="script_token"&gt;true (see instructions &lt;A href="https://help.qlik.com/en-US/connectors/Subsystems/ODBC_connector_help/Content/Connectors_ODBC/How-to-load-without-SELECT.htm" target="_self"&gt;here)&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;in addition it will be necessary to include&amp;nbsp; !EXECUTE_NON_SELECT_QUERY in the query&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Option 1 &lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Simple query&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;SQL SET ANSI_NULLS ON !EXECUTE_NON_SELECT_QUERY;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;SQL SET NOCOUNT ON !EXECUTE_NON_SELECT_QUERY;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;SELECT * FROM &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;master.sys.syslanguages;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;H4&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Option 2 &lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;If you get syntax&amp;nbsp;errors you can attempt to use a variable&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;vSQLScript = 'SET NOCOUNT ON !EXECUTE_NON_SELECT_QUERY;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;SELECT * FROM &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;master.sys.syslanguages;';&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;SQL $(vSQLScript);&lt;/FONT&gt;&lt;/PRE&gt;
&lt;H4&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Option 3&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;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:&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;SQL EXEC sp_databases;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;H3&gt;&lt;FONT face="arial, helvetica, sans-serif"&gt;SQL Native Driver&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;&lt;FONT face="arial, helvetica, sans-serif"&gt;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)&lt;/FONT&gt;&lt;/P&gt;
&lt;H4&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Option 1 &lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Simple query&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;SQL SET NOCOUNT ON ;&lt;BR /&gt;SELECT * FROM &lt;BR /&gt;master.sys.syslanguages;&lt;/PRE&gt;
&lt;H4&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Option 2 &lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;If you get syntax&amp;nbsp;errors you can attempt to use a variable&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;vSQLScript = 'SET NOCOUNT ON ;&lt;BR /&gt;SELECT * FROM &lt;BR /&gt;master.sys.syslanguages;';&lt;BR /&gt;&lt;BR /&gt;SQL $(vSQLScript);&lt;/PRE&gt;
&lt;H4&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Option 3&lt;/FONT&gt;&lt;/H4&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;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:&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;SQL EXEC sp_databases;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jan 2026 11:51:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Sense-Enterprise-on-Windows-Execute-SQL-Set-statements-or/ta-p/1936627</guid>
      <dc:creator>NadiaB</dc:creator>
      <dc:date>2026-01-12T11:51:16Z</dc:date>
    </item>
  </channel>
</rss>

