Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting the files from a file group
Message
De
10/06/2015 11:22:59
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Getting the files from a file group
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01620835
Message ID:
01620835
Vues:
59
The following command get the objects related to a file group:
SELECT OBJECT_NAME(object_id), *
FROM sys.data_spaces ds
INNER JOIN sys.allocation_units au ON
	ds.data_space_id = au.data_space_id
INNER JOIN sys.partitions p ON
	au.container_id = 
		CASE 
			WHEN au.type = 2 THEN p.partition_id
		ELSE p.hobt_id 
		END
WHERE ds.name = 'MyFileGroup'
This gives one record. In that record, there is not really any user friendly name of which file it is. Anyone would know, from there, what to do to get the file so I can remove the file first and then retry this command:
ALTER DATABASE MyDatabase REMOVE FILEGROUP [MyFileGroup]
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform