Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Location of data directory
Message
 
 
À
05/09/2003 08:54:48
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Copies de sauvegarde
Divers
Thread ID:
00826365
Message ID:
00826684
Vues:
26
This message has been marked as the solution to the initial question of the thread.
Hi Joel,

Keep in mind that each DB can be located in it's own directory or even in multiple directories. The following select will return directory for the primary filegroup for each DB.
SELECT name, filename,
		REVERSE(SUBSTRING(REVERSE(filename), CHARINDEX('\', REVERSE(filename)), 4000))
	FROM master.dbo.sysdatabases

>Is there a way to locate the SQL Server data directory using T-SQL? For MSDE customers, I want to implement a one-click backup, and that involves knowing which directory to put the backup in. I would prefer to put it in or relative to the data directory (or some other SQL Server directory). If I don't specify a directory, the backup file is put in the Windows System32 directory.
>
>Any suggestions would be appreciated. Thanks.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform