Forum Discussion

wpenfold's avatar
wpenfold
Contributor
2 years ago
Solved

Is there a way I can delete a folder and all files and subfolders from a windows server?

When an employee leaves, their personal folder and any subfolders and files they have created needs to be deleted. I know I can delete an empty directory, but how can i find/delete all the files and ...
  • jcornelius's avatar
    4 years ago

    @Damone
    do it all in SQL
    ie
    IF EXIST(Select id from table_x where id=@id)
    BEGIN
    UPDATE table_x set col1=@col1 where id=@id
    END
    ELSE
    BEGIN
    INSERT INTO into table_x (id,col1) values(@id,@col1)
    END