cancel
Showing results for 
Search instead for 
Did you mean: 

Get Hana server version through sql query

Former Member
0 Kudos

I need to get for some logging the version of the hana server. Does one know what would be the Hana equivalent or similar query to

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition'), @@version 

The closest I could find is

select * from M_DATABASES

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos
Former Member
0 Kudos

m_database sounds more like db related not server related

lbreddemann
Active Contributor
0 Kudos

So?

Former Member
0 Kudos

And it does not fit with the way I retrieve same information from MsSQL, meaning one set of information set per server as opposed to one per database.

Database version sound quite different then server version, so I'm not sure it is the same stuff.

lbreddemann
Active Contributor
0 Kudos

Well, one thing here is that MS SQL Server clearly uses a different scheme to indicate its software version.

So, you wouldn't get the same semantics here anyhow.

For logging purposes, where you want to simply capture the currently used software version, it's definitively precise to do:

select version from m_database.

Technically it's possible to have multiple SAP HANA installations on the same machine with different SPS and revision levels.

So, asking for the "machine-level" or "server-level" version doesn't make much sense here.

Instead, what's relevant is always what software you're currently using; and that is what M_DATABASE provides you.

If you feel that you need to separate the different components of the version string (major.minor.patch.build) that's trivial too:

select version,

     substr_before (version, '.') as major,

     substr_before (substr_after (version, '.'), '.') as minor,

     substr_before (substr_after (substr_after (version, '.'), '.') , '.') as patch

from m_database;

(build is of no practical relevance for customer, so I left it out).

- Lars

Answers (0)