• I think that T-SQL is a horrible tool for this job. Did you consider any alternative, such as a powershell step in a SQL Agent job?

    -- Gianluca Sartori