How to upload data to FTP or SFTP server from a SQL-CLR procedure (SQL Server 2012 and VS 2012)

Since Microsoft SQL Server 2005, stored procedures (and some other database objects) can be written externally in some .NET language, imported to the SQL database and called as stored procedures. The following sample demonstrates how to call Rebex FTP component from the T-SQL code in the environment of SQL Server…