I am new to SMO and VB.NET and I need to access the transaction log's physical file name and path so that I can correctly relocate it when it is restored on a different.
What I would like to do is display the database and log's physical file and path names in some type of data control for selection by a user during a restore operation.
I have been able to do this for the database but can't seem to get it to work for the log file. How do I find the log file's physical file name and path using SMO? I can't seem to be able to relate the logfile collection and class to specific databases.
Thanks for your help!
Database.LogFiles property gives you a collection of LogFile object, each of which represents a log file on the database. You can access the location and name of the log file using LogFile.FileName and LogFile.Name properties respectively. Refer BOL for more details.
Thanks,
Kuntal
No comments:
Post a Comment