0

I have created a program with C# WinForms where the user enters personal information along with uploading an image of their choice, all the entered data is stored in a single SQL Server table while the image is stored in a folder that is located on the Desktop, the stored image has the same name as person's name, (for example if they type "john" in the process of entering their data, the image stores with the same name).

Through the use of SQL Server Agent I want to delete the image when the record that is associated with the image is deleted, the row also automatically gets deleted using SQL Server Agent.

Is there any way to implement this, it would be amazing if this can be done using SQL Server Agent and not a manually executed procedure.

Dale K
  • 25,246
  • 15
  • 42
  • 71
simon
  • 19
  • 4
  • _I have created a program with C# WinForms_ - isn't this is a job for the program you created? – Fabio Jan 26 '20 at 19:47
  • @Fabio i want it to be deleted through SQL Server Agent not when i'm running the program – simon Jan 26 '20 at 19:57
  • *Why* do you want to do this through agent? It doesn't make sense to. – Thom A Jan 26 '20 at 20:09
  • @Larnu well mainly because i want it to be an automated process, i don't want to run the program for it to be deleted. is there any other way that you would suggest ? – simon Jan 26 '20 at 20:17
  • 2
    And deleted the image when you delete the row isn't "automated"? @Fabio is right, the correct place to do this is in the application. SQL Server should be worrying about the data, not the application files. The application should be worrying about the application files; in this case, the images. – Thom A Jan 26 '20 at 20:21

0 Answers0