SQL Server, what is a session?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
formi
Posts: 39
Joined: Thu 17 Apr 2008 13:01

SQL Server, what is a session?

Post by formi » Mon 18 Nov 2013 16:03

Hi
I Change the language to "deutsch" with SQL "SET language deutsch". I read that this language is valid during the session. Now I have the problem that suddenly my app "forgets" this setting and I get an error using a query with a date. I never close the connection (made a ShowMessage in "onDisconnect". So my question is: when is a session closed or what can be the problem? Thanks, Peter

AndreyZ

Re: SQL Server, what is a session?

Post by AndreyZ » Mon 18 Nov 2013 16:22

Hello,

1. To set the SQL Server language name, you should set the Language SQL Server specific option. Here is a code example:

Code: Select all

UniConnection.SpecificOptions.Values['Language'] := 'Deutsch';
UniConnection.Open;
For more information, please refer to the "UniDAC and SQL Server" article in the UniDAC documentation.

2. In UniDAC, session means TUniConnection. Whilst TUniConnection is opened and the language is set, it will be used by SQL Server for this session. If TUniConnection is not closed, it means that the problem occurs because there is another call of the "SET LANGUAGE" statement within the connection. Make sure you do not call the "SET LANGUAGE" statement somewhere else in your application.

Post Reply