Microsoft
Software
Hardware
Network
Question : "Transaction Log Backup" - T-SQL commands help needed in SQL Server 2000 / 2005 / 2008 !
Hi,
I have the following table. I want a simple example on "TRANSACTION LOG BACKUP" how it works. Can you please provide me the T-SQL commands needed to achieve this ?
USE Sample
GO
-- Create a table
CREATE TABLE T
(
X int,
Y int
)
GO
-- Insert some data
INSERT INTO T VALUES (1, 20)
GO
INSERT INTO T VALUES (2, 30)
GO
INSERT INTO T VALUES (3, 40)
GO
INSERT INTO T VALUES (4, 50)
GO
INSERT INTO T VALUES (5, 60)
GO
INSERT INTO T VALUES (6, 70)
GO
INSERT INTO T VALUES (7, 80)
GO
I want to take Transaction Log Backup. Please provide me commands. I have the following command. I am not sure whether it is correct or not.
-- Backup transaction log
USE Master
GO
BACKUP LOG Sample TO DISK = 'D:\Sample_tran1.bak' WITH INIT
GO
What does mean by INIT here ? Is it needed ? Also please provide me how to restore the transaction log using T-SQL commands.
INSERT INTO T VALUES (8, 90)
GO
INSERT INTO T VALUES (9, 100)
GO
Now i want to take the "Transaction Log Backup" here.
-- Backup transaction log
USE Master
GO
BACKUP LOG Sample TO DISK = 'D:\Sample_tran2.bak' WITH INIT
GO
Appreciate your time and patience !
Thanks
Answer : "Transaction Log Backup" - T-SQL commands help needed in SQL Server 2000 / 2005 / 2008 !
why do you want to restore the log?
you can't restore a transaction log backup without restoring a full database backup first
Random Solutions
Exchange 2003 Enterprise Offline Defrag
"Work Offline" dialog box appears when Windows Explorer 'File' button selected
How do we intecept events in excel VIA VBA
table name as variable
Apache won't start
ODBC timeout issue with access connecting to an SQL database
Configuring onboard audio in Linux
How to start Backup Server
hide a button
For backups using RMAN, setting NLS_LANG, NLS_DATE and parameter BACKUP_TAPE_IO_SLAVES