Can we delete the physical file from server when I delete the corresponding entry from database?
i.e., C:\Test\Test.txt -> when deleting this record from database, i need to delete the corresponding Test.txt file from mentioned location.
Is there a way, I m using SQL 2008.
Any help would be highly appreciable..
Thanks
The ways are:
xp_cmdshellproc (exec master..xp_cmdshell ‘del C:\Test\Test.txt’)Both ways are ugly
And once again – it is the worst practice. Server should not delete user files, or any files, is they are not integral part of its database.