Why My Script Stops After 1st Command

My script is very simple. It call isql and then echo a message. The problem is after the 1st command (isql), it stops so that the echo line never gets executed. Can anyone let me know what is wrong?

#!/usr/bin/sh

userid=xxxx
server=xxxx
db=xxxx
pwd=xxxx

isql -U ${userid} -S ${server} -P ${pwd} -D ${db} << EOF -o result.log
set nocount on
go
select top 10 * from table
go
EOF

echo "finished"

the file "result.log" is created successfully but however the message "finished" never shows up.

There might be an extra space after the last EOF.

is ur isql command working properly ??

#!/usr/bin/sh

userid=xxxxxxx
server=xxxxxxxx
db=xxxxxxxx
pwd=xxxxxxx

isql -U ${userid} -S ${server} -P ${pwd} -D ${db} << EOF -o result.log
set nocount on
go
select something something
go
EOF

echo $"finished"[

make sure there is no space before 2nd EOF (Second EOF should be at the start of the line)

Yes, you are right! I removed the extra space character and now it works. thanks!