Reputation: 119
I need to determine present databse server name where i am running my sql so that i can perform some certain steps depending upon the environment.
Anybody know how to do this ?
Upvotes: 2
Views: 20575
Reputation: 466
SELECT ASEHostName()
on the ASE Instance will give you the Physical Machine Name , while
SELECT @@SERVERNAME
will give you the Database Server name that you would give when you setup ASE instance during installation.
-- In 'thoughts'...
Upvotes: 2
Reputation: 885
SELECT @@servername
Why? Because @@servername is a global variable and returns the name of the SAP ASE server.
Upvotes: 7
Reputation: 734
the ASE database server name can be found in:
1) in interfaces file (UNIX) or using DSEDIT in Windows
2) running select * from master..sysservers
Upvotes: 1