Is it possible to pass a variable like App through the SQL server database connection string?


The app_name() in SQL server can be override by the App variable in the connection string. Is there a way in Lucee that we can similarly override a variable such that the value can be used in a view?

For testing, I created a view in SQL server as below:

SELECT app_name() AS outputData

When I run this view, returns the string “Microsoft JDBC Driver for SQL Server”.
Is there a way I can set a value to the App variable so that it gets returned when I call this view?


You can likely add this in the connection string within the Application.cfc ( and I believe you can also edit the connection string in the admin. Either way, try adding ;App=[whatever] to the connection string and seeing if that gets passed through.