How to create folder on server in SP (MSSQL)

Hello

I have a stored procedure which does a backup:

CREATE PROCEDURE dbo.NightAuditBackup @Backup VarChar (255), @RetainDays
INT AS

-- if path does not exist then create folder

BACKUP DATABASE [TECHOTEL PICASSO] TO DISK = @Backup WITH NOINIT,
DESCRIPTION = N'Performed by NightAudit', NOUNLOAD, NAME = N'Picasso
Database', NOSKIP, NOFORMAT, RETAINDAYS=@RetainDays
GO

fails if the backup path does not exist.

Hoe can check if path exists, and if not, create the path.

Thanks for any helpers

--
Jacob Pedersen
AK Techotel
J.Peder...@nospamtechotel.dk
(Remove nospam when replying!)