I don't want to hard-code external database name in the code.
In the following code, I was able to get the SQL server value but I don't know how to get external database name which is part of same SQL server.
static void testODBC(Args _args)
SysSQLSystemInfo systemInfo = SysSQLSystemInfo::construct();
xSession = new xSession();
// Prints the name of server for the current session.
Any idea how I can get external database name which is part of same SQL server via X++ code?
You could use a direct SQL query to run EXEC sp_databases or something like that.