Search code examples
sqlsql-serverrshinyflexdashboard

SQL Logon failure due to trigger when running R Flexdashboard


I'm running into an issue when trying to query from a sql database using flexdashboard.

Below is my connection (with dummy info). If I run the connection from my regular R session it works without any issues. The problem is when I try to run it as part of a flexdashboard.

At that point I get an error saying:

'Logon failed for login 'un' due to trigger execution.'

Any clue what might be causing this issue?

con_autorpt = DBI::dbConnect(odbc::odbc(),
                             Driver = "SQL Server Native Client 11.0",
                             Server = "server\\server",
                             Database = "db",
                             UID = "un",
                             PWD = "pw",
                             Port = port#
)

Solution

  • The clue is in the error message. There is a logon trigger for your instance that is doing something. Ask the DBA of that instance. More information in the documentation here.