Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 FTP result

Author  Topic 

peace
Constraint Violating Yak Guru

420 Posts

Posted - 2013-04-02 : 05:49:08
is there any sql script where i can FTP over to another location?

select * from #temp result to FTP over.

is that possible?

MIK_2008
Master Smack Fu Yak Hacker

1054 Posts

Posted - 2013-04-02 : 05:50:34
Do you mean to have result of a table which is on any other server?

Cheers
MIK
Go to Top of Page

peace
Constraint Violating Yak Guru

420 Posts

Posted - 2013-04-02 : 06:04:57
to push the result into txt format and FTP over
Go to Top of Page

peace
Constraint Violating Yak Guru

420 Posts

Posted - 2013-04-02 : 06:06:00
i try this

https://kb.hivelocity.net/ftp-through-an-mssql-stored-procedure/

but where to input to run my store proc?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-04-02 : 07:10:27
one way is to use ssis package with Execute SQL task to execute procedure and save results and then a FTP task to FTP it to your required server



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

MIK_2008
Master Smack Fu Yak Hacker

1054 Posts

Posted - 2013-04-02 : 08:35:58
Another way around could be using xp_cmdShell in combination of "bcp" command. If you're not famaliar with them then explore them. As a matter of fact I had utlized them for exporting data into excel files and them moving those files from my sql server machine to another machine. But in my case the destination machine was on the same domain.

Cheers
MIK
Go to Top of Page

peace
Constraint Violating Yak Guru

420 Posts

Posted - 2013-04-02 : 09:24:31
FTP sql script not possible?
Go to Top of Page

MIK_2008
Master Smack Fu Yak Hacker

1054 Posts

Posted - 2013-04-02 : 13:21:27
I would not say "not possible" but at least I am not aware of "FTP sql Script" terminology. However the solution/idea I provided earlier is what I had implemented via stored procedures and was simply calling those procedures.

Cheers
MIK
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-04-02 : 13:40:07
quote:
Originally posted by peace

FTP sql script not possible?


possible if you can use third party tools like WinSCP which has command line .But you still need to use xp_cmdshell to call it though

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -