Is there any way to know what database you're connecting to??
Printable View
Is there any way to know what database you're connecting to??
Huh?
Name of database? Wouldn't that be part of the connection string? :confused:
Nop. In the Connection String you set the IIS, and you refer to an INI (msdfmap.ini) where the connection string resides.
Anyway, isn't there any Trans-SQL query to get the database which you're connecting to?
Actually, you refer to a "part" of the INI. The INI is always that one (as far as I know). You can create several different connections, each of them with different [names].
Found it!! Thanks to a friend online... I got the answer. It is:
SELECT DB_Name()