LISTING 4: Script That Commits a Transaction That Spans
Two Filegroups, Then Backs Up the Database
BEGIN TRAN
INSERT INTO table1
SELECT 'This is before the backup'
INSERT INTO table2
SELECT 'This is before the backup'
COMMIT TRAN
GO
BACKUP DATABASE testdb
TO DISK = 'c:\backup\testdb.bak'
WITH init