How to determine what DB is used
-
Hi all, Is it possible to determine what db is being used with a sql statement or something more or less the same. i.e. Be it MySQL, MSSQL, DB2 .... Many thanx .... again. Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r
-
Hi all, Is it possible to determine what db is being used with a sql statement or something more or less the same. i.e. Be it MySQL, MSSQL, DB2 .... Many thanx .... again. Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r
How do you mean? Surely if you are hitting the DB, then you will have access to the connection object which would have this info?
-
How do you mean? Surely if you are hitting the DB, then you will have access to the connection object which would have this info?
Yes you are correct ... but I have no idea how to retrieve that object ?
The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r
-
Yes you are correct ... but I have no idea how to retrieve that object ?
The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r
Programm3r wrote:
but I have no idea how to retrieve that object ?
In order to connect to a database you must need some sort of connection. That connection object will have a IDbConnection.ConnectionString[^] property implementation from the
IDbConnection
interface. (So it doesn't matter what type ofConnection
object you have, you can always access it through theinterface
)
Upcoming Scottish Developers events: * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos
-
Hi all, Is it possible to determine what db is being used with a sql statement or something more or less the same. i.e. Be it MySQL, MSSQL, DB2 .... Many thanx .... again. Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r
-
Many thanx for the response, If I run select db_name() it returns the name of the database, the thing I looking for is the actual database package name, like MSSQL or MySQL, does it make sense, is it possible? Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r