When I created this stored procedure, I notice that when if the file name has space between the letter, it won't delete it.
How do I delete the file that has space between the letter?
of should I create a '-' when I upload the file? if so how do I do that?
Create Proc DeleteCategory (
SET NOCOUNT ON
--Delete the file from the server
If @CategoryImage is not Null or @CategoryImage <> ''
DECLARE @cmd nvarchar(1000)
set @cmd = ' del D:\Sites\uniquepiece\product_images\' + @categoryImage
EXEC master..xp_cmdShell @cmd