maestro
maestro

Reputation: 671

Decide that database is Sybase or SQL Server

I would like to write an SQL script or query which can decide that the used database is SQL Server or Sybase.

How can I do that?

Upvotes: 2

Views: 174

Answers (1)

aF.
aF.

Reputation: 66697

You can use select @@version


In SQL Server it would present something like this:

Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64) 
    Jun 17 2011 00:54:03 
    Copyright (c) Microsoft Corporation
    Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: ) (Hypervisor)

In Sybase ASE it would present something like this:

Adaptive Server Enterprise/15.0.3/EBF 16736 ESD#2/P/Sun_svr4/OS 5.8/ase1503/2707/64-bit/FBO/Sun Jul 26 10:29:50 2009    

Upvotes: 3

Related Questions