Home > Forum > Database > Different query execution contexts on environments

Different query execution contexts on environments
0

Hi,

I have a problem with the execution of SQL queries in different environments using a Default connection (after moving the system to AZUR-e servers).

SQL Server Profiler shows that on the TEST server execution of queries using the Default connection uses a different user than on the Dev server - installation seems to be the same (the same users etc.). Is there any option/installation parameter that causes the execution of TEST SQL may be different than the rest of the environments?

Test server query execution:

declare @cookie************************************** varbinary(8000);
execute as user = 'bps_user' with cookie into @cookie**************************************;
begin try
exec('select top 100 * from (
select * from ZZ_Działy_PIT
) as nnn
');
end try
begin catch
revert with cookie = @cookie**************************************;
throw;
end catch;
revert with cookie = @cookie**************************************;

Dev / Prod query execution

select top 100 * from (
select * from ZZ_Dostawca
) as nnn

MVP

Hi Damian,

as Maksymilian already mentioned, as of some version WEBCON uses a dedicated database user without login 'bps_user'. It has has limited read permissions in the database. I have seen that this is only added to "new" installations not updates. Maybe your DEV server already existed a while before you installed the TEST environment with a new user?

Regardless of the reason the "workaround" is as already mentioned, create a new database connection with and use this connection instead of the default one. This may also be necessary if you want to join the tables form the content with table from the attachment database. This is not possible for a 'database user without login'.

Best regards,
Daniel

In reply to: Daniel Krüger (Cosmo Consult)

Hi Damian,

as Maksymilian already mentioned, as of some version WEBCON uses a dedicated database user without login 'bps_user'. It has has limited read permissions in the database. I have seen that this is only added to "new" installations not updates. Maybe your DEV server already existed a while before you installed the TEST environment with a new user?

Regardless of the reason the "workaround" is as already mentioned, create a new database connection with and use this connection instead of the default one. This may also be necessary if you want to join the tables form the content with table from the attachment database. This is not possible for a 'database user without login'.

Best regards,
Daniel

Hi Daniel, Hi Maksymilian,

Thank you for the answers.

Yes DEV was installed on the Azure server as 2021.1.4.84 and updated to 2022 but TEST was installed originally as 2022 ver. I will try to re-install the TEST.

As a workaround I found as well that I need to use the new connection to read from database views, etc. I can read all data from SQL with the new connection.

But another problem appears when I want to start sub-workflows from a data table in the external database PIT - there it is not possible to choose connections to read data.


Error in On path action Uruchamia podobiegi do windykacji miękkiej. (Step: Registration, path: Wyślij zaległe faktury do osób odpowiedzialnych)
The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction.
The server principal "S-1-9-3-*************************************" is not able to access the database "PIT" under the current security context.