Restoring a database can be done in two ways, namely:
- Using the manual method
- Using Enterprise Manager
1. Manual
Manual way can be done like you copy-paste files in Windows Explorer. To restore from the original folder, click Paste on the original destination folder, namely:
C:\Program Files\Microsoft SQL Server\MSSQL\Data\.
2. Enterprise Manager
To restore a database that has been backed up, the steps are as follows:
- Select Start → Programs → Microsoft SQL Server → Enterprise Manager. Then select the Database object.
- Right-click on the Database object, then select All Tasks → Restore Database.
- In the Restore Database window, in the Restore as database section, select the name of the database to be restored. In the Restore section, select Database or select Filegroups or File if the file being restored is a file and select From device if the database/file being restored is from a CD/DVD/HD. In the Parameters group, in the Show backups of database section, select the name of the database backup to be restored. Then in the First backup to restore section, select the database backup file from the database previously selected in the Show backups of database section.
- Note: if you have ever backed up the same database more than once, then this section will list multiple database backup files.
- After all parameters are filled, select OK, then wait for the backup process to complete. If the process is complete, a confirmation message will appear, then click OK.
SQL Server Operators
In SQL Server, there are also many operators known as in programming languages, to manipulate data, look at the tables below.
Arithmetic Operators by level
| Operator | Fungsi |
|----------|----------------|
| * | Perkalian |
| / | Pembagian |
| % | Sisa pembagian |
| + | Penjumlahan |
| - | Pengurangan |
Relational Operators
| Operator | Keterangan |
|----------|------------------------------|
| = | Sama dengan |
| > | Lebi besar |
| < | Lebih kecil |
| >= | Lebih besar atau sama dengan |
| <= | Lebih kecil atau sama dengan |
| <> | Tidak sama dengan |
Logic Operators
| Operator | Fungsi | Keterangan |
|-------------|----------------------|------------------------------------------------------------|
| NOT atau != | atau pembalik nilai. | Data dianggap benar bila nilainya salah |
| OR atau || | Atau | Data dianggap benar bila salah satu bernilai benar |
| AND atau && | Dan | Data dianggap benar bila kedua nilai benar |
| XOR | Exclusve or | Data dianggap benar bila hanya data pertama bernilai benar |
OR Operator Logic
| Kondisi1 | Kondisi2 | Hasil |
|----------|----------|-------|
| False | False | False |
| False | True | True |
| True | False | True |
| True | True | True |
AND Operator Logic
| Kondisi1 | Kondisi2 | Hasil |
|----------|----------|-------|
| False | False | False |
| False | True | False |
| True | False | False |
| True | True | True |
NOT Operator Logic
| Kondisi | Hasil |
|-----------|-------|
| NOT True | False |
| NOT False | True |