Any suggestion on how to achieve the same without using cmdshell command?
I prefer using SSIS to output files from SQL Server - and in my SSIS packages I setup a process task that runs WinSCP to FTP the files when necessary. You could use Powershell to get the data and FTP/SFTP - or any other scripting language in combination with SQLCMD and/or BCP to output the data from SQL Server.
Jeffrey Williams Problems are opportunities brilliantly disguised as insurmountable obstacles.