Home » Reply » Reply To: how to remove secondary transaction log file?

Reply To: how to remove secondary transaction log file?

Stephen West ~ Modified: November 28th, 2015 ~ ~ 1 Minute Reading

Home Forums how to remove secondary transaction log file? Reply To: how to remove secondary transaction log file?

#925 Score: 0
Stephen West
Moderator
4 pts

Try this

SELECT o.name AS TableOrIndex
 FROM sysfiles f
JOIN dbo.sysfilegroups s
 ON f.groupid = s.groupid
JOIN dbo.sysindexes i
 ON i.groupid = s.groupid
JOIN dbo.sysobjects o
 ON i.id = object_id(o.name)
 AND i.indid in (0, 1)
WHERE f.name = 'My_Logical_File_Name'
UNION
SELECT i.name
 FROM sysindexes i join sysfilegroups f ON i.groupid = f.groupid
 JOIN sysfiles l ON f.groupid = l.groupid
WHERE l.name = 'My_Logical_File_Name'