/*
  In Query Analyzer window, if only certain SQL statements
    need to be executed, highlight those statements
    and click 'Execute Query' (Green arrow) icon.

  Prabu 5/23/05

  Multi-line comments can be enclosed by a air of /* and  
*/

-- Single line comment needs to be prefixed with '--'

select databasepropertyex ('henry', 'recovery')

alter database Henry set recovery simple

select databasepropertyex ('henry', 'recovery')

backup database henry to disk = 'p:\tmp\henry.bak'

sp_addumpdevice 'disk', 'HDataBack', 'p:\tmp\henry.bak'

-- the association between logical name and the physical file 
--   is stored in sysdevices table in master database

backup database henry to HDataBack with init

sp_addumpdevice 'disk', 'HLogBack', 'p:\tmp\hlog.bak'

backup log henry to HLogBack with init

alter database Henry set recovery full

select databasepropertyex ('henry', 'recovery')

-- perform some updates on Henry database before testing the next statement

backup log henry to HLogBack with init

Restore database Henry
From HDataBack
  with norecovery


Restore log Henry 
From HLogBack
  with recovery

