• I agree with Florian - xp_cmdshell is useful in situations (like the example given)...

    Bhuvnesh - I only suggested that you could use SQL CLR instead...samples on SQL CLR are available at http://www.codeplex.com/MSFTEngProdSamples/ and that would give you a good starting point from where you could write your own implementation...