Home > Forum > Database > Sql query to list all of the application

Sql query to list all of the application
0

HI
I need by sql query to outline the list of the appliacation that we have and a workflows to a choice field. How can I do if the app is on Main_Db and we have apps on Main_db and main_db2?

MVP

Hi,

if you have two databases and want to display all applications in one application you will require a custom MSSQL database connection.
This database connection will use a user, who can access both databases.

Then you could create you SQL query like:
SELECT 'Main db' as DatabaseName, [APP_Name]
FROM [Main_DB].[dbo].[WFApplications]
union
SELECT 'Main_DB2' as DatabaseName, [APP_Name]
FROM [Main_DB2].[dbo].[WFApplications]

If you have dev/test/prod environment with different database names, you could add a constant for Main_DB and MainDB2, which you could use in the query.

Best regards,
Daniel