we will send folder path as a parameter, need to delete all the files in the specific folder
NOTE : not the folder
here is my code below. thanks in advance for spending your precious time in it.
EXEC @HR = SP_OACREATE 'SCRIPTING.FILESYSTEMOBJECT',@OLE_FILESYSTEM OUT
EXEC @HR = SP_OAMETHOD @OLE_FILESYSTEM, 'DELETEFILE',NULL, @FILE_PATH
EXEC @HR = SP_OADESTROY @OLE_FILESYSTEM
Line 2 returns -2147352570