sp_can_tlog_be_applied (Transact-SQL)
SQL Server 2008 R2
Verifies that a transaction log can be applied to a database. sp_can_tlog_be_applied requires that the database be in the Restoring state.
The following example declares a local variable, @MyBitVar, to store the result.
USE master;
GO
DECLARE @MyBitVar BIT;
EXEC sp_can_tlog_be_applied
@backup_file_name = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\AdventureWorks2008R2.bak',
@database_name = N'AdventureWorks2008R2',
@result = @MyBitVar OUTPUT;
GO