I recently upgraded from sql 2005 to sql 2008. I had a routine to truncate the log using the database.truncatelog method. But now when I run the following code I get the following error. Books on line does not indicate that the method should not be used on 2008 databases. Note: The database was detched from a 2005 sql instance and attached to a sql 2008 instance. Any ideas?
db.Shrink(0, ShrinkMethod.Default)
db.TruncateLog()
Error:
Microsoft.SqlServer.Management.Smo.UnsupportedVersionException: This method or property is accessible only while working against a version earlier than SQL Server 2008.
Thanks,
John