MS Sql Server: Deleting A DatabasePresentation Transcript
9 SQL SERVER: DELETINGA DATABASE
DCL COMMANDS WHAT IS DCL? DATA CONTROL LANGUAGE As the name suggests, DCL is used to control Data. It can be used to save or delete tables or rollback to an existing save point. Save Point: It is a marker that represent a point of integrity in a database transaction. It is more like a backup or a restore point that we use in windows. The Next slide illustrates the Save points concept better.
Deleting tables Dropping of tables: Microsoft SQL Server 2008 provides yet another simple keyword for deleting the table. And that is the word ‘DROP’ drop table tablename; The SQL Command drop deletes the table permanently and beyond recovery. Hence, it is advisable to reconsider deletion before performing it.
Saving tables Saving the existing work so that it can be resumed with later Microsoft SQL Server 2008 commits to us in this matter by providing us with the keyword ‘COMMIT’ commit; Caution: Once used, we cannot undo the changes made to the table previous to this command.
Saving tables Undo-ing the changes done to the table: Microsoft SQL Server 2008 provides a solution with the simple keywords: ‘savepoint’ and ‘Rollback’ Create a Save point savepointsavepointname; Reverts the database state to the most recently created save point rollback; NOTE: You cannot rollback the DDL commands but only DML commands. So be cautious!!!
Summary 9. Deletinga database
Creating Save points
Visit more self help tutorials Pick a tutorial of your choice and browse through it at your own pace. The tutorials section is free, self-guiding and will not involve any additional support. Visit us at www.dataminingtools.net