![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
I’m an Oracle transplant to the SQL Server 2008 adjusting and enjoying many new features but missing some Oracle features I can’t find the equivalent too. One of them being the best “secure” technique to extract a query into a text file to then be FTP’d to another machine. This will be a daily scheduled or triggered task. In my Oracle days a simple “spool” command did the trick From what I can find so far BCP seems to be best solution, but I’m trying to keep this in a T-SQL procedure without using the xp_cmdshell. BCP.EXE "select CustomerID, CompanyName from Northwind..Customers where City='London'" queryout LondonCustomers.csv -c -CACP -t, -T |
#4
| |||
| |||
|
|
George Lewycky (gele... (AT) nyct (DOT) com) writes: I’m an Oracle transplant to the SQL Server 2008 adjusting and enjoying many new features but missing some Oracle features I can’t find the equivalent too. One of them being the best “secure” technique to extract a query into a text file to then be FTP’d to another machine. This will be a daily scheduled or triggered task. In my Oracle days a simple “spool” command did the trick From what I can find so far BCP seems to be best solution, but I’m trying to keep this in a T-SQL procedure without using the xp_cmdshell. * * *BCP.EXE "select CustomerID, CompanyName from Northwind..Customers where * * *City='London'" queryout LondonCustomers.csv -c -CACP -t, -T The best solution may be to use SQL Server Integration Services, but I have never used SSIS myself. If this is to be scheduled, you could run it from SQL Server Agent as a command-line task that invokes BCP. -- Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se Links for SQL Server Books Online: SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx SQL 2000:http://www.microsoft.com/sql/prodinf...ns/books.mspx- Hide quoted text - - Show quoted text - |
#5
| |||
| |||
|
|
for some reason my manager doesnt want me using SSIS for this task but ill re-iterate to him |
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |