I have a file inside a directory \\myServer\Admin\temp\testtemp.txt
I need to write a TSQL to
- Search for
testtemp.txt
file. - If exists, create a copy of it and rename it to
Copytesttemp.txt
If there's
testtemp.txt
already in the above directory like this\\abcd\Admin\temp\Copytesttemp.txt
then delete it and recreate
Copytesttemp.txt
How do I achieve it? Thanks.