If you run the following query on SQL Server it will tell you the name of the database you are in.
<pre>SELECT db_name()</pre>
As fr as I know there is no code that can be run on both SQL Server and Oracle to find out what platform you are connected to.
Last Wiki Answer Submitted: July 2, 2008 7:59 pm by Denny Cherry64,520 pts.
All Answer Wiki Contributors: Denny Cherry64,520 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
To see if Oracle or SQL Server are running check each’s version – one will return an answer the other will cause an error. Handle the error – and you know if it is Oracle or SQL Server.
To determine which version of Microsoft SQL Server:
SELECT SERVERPROPERTY(‘productversion’), SERVERPROPERTY (‘productlevel’), SERVERPROPERTY (‘edition’)
To determine which version of Oracle:
select * from v$version
where banner like ‘Oracle%’;
It should return something like this:
Oracle9i Enterprise Edition Release 9.2.0.1.0 – 64bit Production
Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.
To see if Oracle or SQL Server are running check each’s version – one will return an answer the other will cause an error. Handle the error – and you know if it is Oracle or SQL Server.
To determine which version of Microsoft SQL Server:
SELECT SERVERPROPERTY(‘productversion’), SERVERPROPERTY (‘productlevel’), SERVERPROPERTY (‘edition’)
To determine which version of Oracle:
select * from v$version
where banner like ‘Oracle%’;
It should return something like this:
Oracle9i Enterprise Edition Release 9.2.0.1.0 – 64bit Production