I'm trying to create a SQL Server Stored Procedure to generate an XML file. Once the file is generated, it has to SFTP the file to a UNIX Server. I've never done the SFTP stuff before so here I'm seeking help. Please take a look at the below Stored Procedure that I've written and help me out. USE [myDB] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROC [dbo].[GenerateXML] AS SELECT FileID, SystemID, FileName FROM dbo.File FOR XML raw('File'), elements, root('File') DECLARE @cmd VARCHAR(255) SET @cmd = 'osql -E /Q “exec GenerateXMLproc” /o usadevenv01:/home/xml/file.xml' EXEC xp_cmdshell @cmd GO |
↧
SFTP a file created on SQL Server with a Stored Procedure to a UNIX Server
↧