I'm restoring transaction logs to a database, but need a way to know which transaction log I should start with. Typically I'll see something like this:
The log in this backup set terminates at LSN 103000001633300001, which is too early to apply to the database. A more recent log backup that includes LSN 103000002524300001 can be restored.
So how do I get the LSN 103000002524300001 programattically? The database is in NORECOVERY mode so DBCC LOG doesn't work. I've got records of the transaction logs themselves so I know what their first and last LSN's are. I just don't know where the database itself currently sits.