Case study 15: Check Sybase version
  • Platform: HP-UNIX 11, Tru64 , Windows
  • Sybase ASE version: 12.5.x
  • Background story: Many clients have different Sybase ASE versions, and it is necessary to check which version they have.
  • Task: Make script for checking Sybase version.
  • Solution: Sybase have several global variables. One of them is @@version which contains Sybase version. To get Sybase version, execute following script:

    select @@version

  • Remark: Other, most commonly used global variable is @@error which contains last error number, often used in triggers and procedures.
    There is @@errorlog which contains path to the Sybase error log, which allows dba not to remember all different error paths for multiple platforms.
    Also, there is @@servername which contains the name of Sybase ASE server, and it can be very useful if you have only IP and port of server, and with @@servername you can easily get other necesary data from interfaces file.
    With @@tranchained Sybase ASE transaction mode can be get.
    For other global variables check Reference Manual: Building Blocks, Chapter Global Variables
   
  powered by myself. DBA-Sybase 2006