how to Connect from ksh script to SQL server

I need to connect sql server 2008 from korn shell script. Can you please give me the script which connects sql server 2008 from korn shell script.

Sorry, but i don't understand what you want to do: you can issue practically any command the same way you issue it on the command line from within a script. If you you have a certain command to contact your SQL server you should be able to use it from inside a script the same way.

And what dou you mean by "connect to"? Start a management console? just issuing a SQL query? send a "ping" to the system hosting it? Please clarify.

I hope this helps.

bakunin

I want to do something like below actually this below code is for Oracle DB I want it for SQL server:

#! /bin/ksh
# @(#)$Header: test_data.ksh

DATA_DIRECTORY="C:\jobs\data"
DBNAME=$1
SCHEMA=$2
PASSWD=$3
CONN1="${SCHEMA}/${PASSWD}@${DBNAME}"

ORACLE_SID=${DBNAME}
export ORAENV_ASK=NO

ZIP_FILE=`ls -lt ${DATA_DIRECTORY}/test_*.zip| awk '{if (substr($1,1,1) == "-" && n++ < 1) print $9}'`
ZIP_CONTENT=`basename ${ZIP_FILE}| awk '{print substr($1,1,10)}'`
unzip -o ${ZIP_FILE} -d ${DATA_DIRECTORY}
mv ${DATA_DIRECTORY}/${ZIP_CONTENT} ${DATA_DIRECTORY}/test.txt

ftp_target="test.txt"

sqlldr  ${CONN1} data="C:\jobs\data\test.txt"
    control="C:\DATA\abcd.ctl" \