-1

I am using Sybase ASE 12.5. My question is when creating a database, why it is necessary to use master database. What does it mean.

use master
create database student
drop student
use pubs2
Mike Gardner
  • 6,611
  • 5
  • 24
  • 34
pankaj
  • 1

1 Answers1

0

The master database is similar to the idea of the root drive in *nix, or the C:\ in windows. It forms the basis of the installation. Using this analogy, the command use is equivalent to changing directories (cd).

By useing the database, you are explicitly telling the software which data structures you are trying to reference, so if you select data from a table, it will look for that table in your current location.

The master database contains all the information for all databases, devices, logins, configurations and more. Because of this you must be in the master database to create new databases.

In practice, unless you are creating or dropping databases, devices, logins, or making other system wide changes, you will not actually use master that frequently.

Mike Gardner
  • 6,611
  • 5
  • 24
  • 34