Link to home
Start Free TrialLog in
Avatar of Madison_Hollister
Madison_Hollister

asked on

How to set options for MS SQL 2005 via isql in linux?

I regularly use MySQL, however am completely unfamiliar with MSSQL and the differences are killing me.
I have a task scheduled hourly to dump data from an Oracle database to a CSV file, which I then import into MySQL, I need now to do the same thing from a MSSQL 2005 database. All I need as results from the script are the comma separated values of the result of the query.
I need help converting the following Oracle script to be run from Debian 5.0 linux via iSQL on the command line, to be able to pull CSV data from MSSQL 2005.
SET FEEDBACK OFF
SET HEADING OFF
SET COLSEP ','
SET PAGESIZE 0
SET LINESIZE 5000
SET TERMOUT OFF
ALTER SESSION SET NLS_DATE_FORMAT='RRRR-MM-DD'
SET TRIMSPOOL ON
 
SPOOL /output/daily
SELECT FIELD1||','||
FIELD2||','||
FIELD 3 FROM TABLE WHERE CLAUSE;
SPOOL OFF
EXIT
QUIT

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial