ARITHABORT

[expired user #9110]'s profile image [expired user #9110] posted 9 years ago in General Permalink
Is there a way to enable and disable ARITHABORT in HeidiSQL?

In MS SQL Server Management Studio this can be set from the Object Explorer by highlighting the root of the connection, right clicking and opening the Connections page of the server properties and setting the arithmetic properties. I cannot find an equivalent in HS. Do these settings exist somewhere else?

I have tried adding the following before the SELECT statement of a query:

SET ARITHABORT ON;
SELECT...

This works but would be good if it is possible to set this in a connection option.
kalvaro's profile image kalvaro posted 9 years ago Permalink
You can pick your stored connection in Session Manager, switch to the "Advanced" tab and use the "Startup script" option to get a custom file loaded. I've been using it for years with MySQL and I understand it should also work with SQL Server.
[expired user #9110]'s profile image [expired user #9110] posted 9 years ago Permalink
Not sure how this will help? here is an example of what may happen:

Lets say you need to browse for some data in a database and you have not just tables but some views you know the data you need to browse is in a particular view so you filter to narrow the list of views and click on the one you want, you then click the data tab now depending what is in the view the data tab will try to do a SELECT * FROM .... then you may get an error msg because the 'ARITHABORT' may need to be set:

"SQL Error (1934): SELECT failed because the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations."

As I indicated in MS SQL Server Management Studio the 'ARITHABORT' can be set so you can avoid this issue. How do you do this with a Startup script in HeidiSQL?
kalvaro's profile image kalvaro posted 9 years ago Permalink


SET ARITHABORT ON;
SELECT...

This works but would be good if it is possible to set this in a connection option.



How do you do this with a Startup script in HeidiSQL?



You save SET ARITHABORT ON; in a file?
[expired user #9110]'s profile image [expired user #9110] posted 9 years ago Permalink
OK so this is relying on the SET ARITHABORT ON; being run as a Startup script then for that session the connection will have the ARITHABORT set to ON.

OK I will try this, thanks for the clarification.
kalvaro's profile image kalvaro posted 9 years ago Permalink
Sorry if we're in general not particularly helpful with SQL Server issues but HeidiSQL has historically been a MySQL client. Support for other DBMSs is something relatively new (and mostly experimental).
[expired user #9110]'s profile image [expired user #9110] posted 9 years ago Permalink
Kalvaro no need to apologise HeidiSQL seems very competent so far also way more intuitive than SSMS to use and the Startup script works well for setting the ARITHABORT option.

Thanks again.

Please login to leave a reply, or register at first.