Isql and If Exist syntax error in UNIX script

Tags
advanced, error, isql, script, shell scripts, sp_help, syntax, unix

 
Thread Tools Search this Thread
# 8  
Old 10-10-2018
I tried to execute only the if exist statement to know if it throws error in starting itself.
Example:
Code:
if exists(select 1 from sysobjects where name = 'sample_table' and type = 'U')
begin
   select 'hi'
end

I get the error as below:
Code:
Error starting at line : 4 in command -
if exists(select 1 from sysobjects where name = 'mbs_pers_del_dp_sample' and type = 'U' )
Error report -
SQL Error: Incorrect syntax near ')'.
Error starting at line : 5 in command -
begin
   select 'hi'
  end
Error report -
Incorrect syntax near the keyword 'begin'.

------ Post updated at 02:19 PM ------

Thank you, let me go through it.

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Isql syntax error in UNIX script Suresh Shell Programming and Scripting 1 10-09-2018 09:56 AM
Using Isql for SQL SERVER to get the table rows counts in UNIX shell script to pimmit22043 Shell Programming and Scripting 6 03-18-2017 03:15 PM
Syntax error on script mutley2202 UNIX for Beginners Questions & Answers 4 12-23-2016 07:21 PM
Syntax Error in Unix Shell Script Mary James Shell Programming and Scripting 4 06-15-2012 07:58 AM
Need to capture error of sybase isql in unix aksar Shell Programming and Scripting 3 01-06-2012 06:04 AM
ISQL syntax can't read nikki1200 Shell Programming and Scripting 3 08-09-2011 02:01 PM
ISQL syntax nikki1200 Shell Programming and Scripting 2 07-20-2011 05:45 AM
Syntax error calling TCL script from shell script marcoss90 Shell Programming and Scripting 1 03-13-2011 10:14 AM
AWK syntax /bailing script error when executing in UNIX nandugo1 Shell Programming and Scripting 4 03-03-2011 07:51 PM
Does not exist or unreadable error in windows ftp script rechever Shell Programming and Scripting 3 07-21-2009 12:10 AM
awk Shell Script error : "Syntax Error : `Split' unexpected Herry UNIX for Dummies Questions & Answers 2 03-17-2008 12:16 PM
Unix Script Syntax mmaller0319 Shell Programming and Scripting 1 02-28-2008 11:02 AM
How to check path exist or not in UNIX shell script suneelc UNIX for Dummies Questions & Answers 3 01-22-2008 08:36 AM
isql query in unix shell script jaydeep_sadaria Shell Programming and Scripting 3 11-14-2007 03:07 AM
Syntax error in script KindHead Shell Programming and Scripting 2 12-12-2006 10:28 PM