Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I know if a folder exists
Message
 
 
À
17/11/2004 16:02:44
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
00962392
Message ID:
00962432
Vues:
27
This message has been marked as the solution to the initial question of the thread.
>Hello all,
>
>I am trying to determine if a folder exist on my server.
>If the folder exist I would like to rename it.
>
>I know I can use the xp_fileexist extended procedure but I do not know how to determined if it is a folder.

See sample code below that shows how you can check for directory existence
CREATE TABLE #temp01 ( FileExists int, IsDirectory int, ParentDir int)
INSERT INTO #temp01 EXEC master..xp_fileexist 'C:\Program Files'
SELECT CASE IsDirectory 
	WHEN 1 Then 'Directory Exists'
	ELSE 'Directory doesn''t Exist or it''s a file' END
	FROM #temp01
DROP TABLE #temp01
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform