I posted this to microsoft.public.sqlserver.programming, but no one
could answer my question. So I think it is a good place to re-post my
question here.
My question:
I found that if you do not include any effective SQL statement between
BEGIN/END block, SQL Server 2000 Query Analyzer will think it is an
error:
Server: Msg 156, Level 15, State 1, Line 6
Incorrect syntax near the keyword 'end'.
if 1=1
select getdate()
else
begin
--select 'ok'
end
Is this behavior a SQL standard or simply a M$ standard glitch? 5 9109
On 31 Aug 2003 22:41:51 -0700 in comp.databases.ms-sqlserver, ne***********@msn.com (Neo) wrote: I posted this to microsoft.public.sqlserver.programming, but no one could answer my question. So I think it is a good place to re-post my question here.
My question:
I found that if you do not include any effective SQL statement between BEGIN/END block, SQL Server 2000 Query Analyzer will think it is an error:
Server: Msg 156, Level 15, State 1, Line 6 Incorrect syntax near the keyword 'end'.
if 1=1 select getdate() else begin --select 'ok' end
Is this behavior a SQL standard or simply a M$ standard glitch?
From books online:
<--
Syntax
BEGIN
{ sql_statement | statement_block }
END
Arguments
{sql_statement | statement_block}
-->
Shows the argument is not optional. :-)
--
A)bort, R)etry, I)nfluence with large hammer.
(replace sithlord with trevor for email)
.......
Can anyone direct me to other newsgroups for this question? ne***********@msn.com (Neo) wrote in message news:<96**************************@posting.google. com>... I posted this to microsoft.public.sqlserver.programming, but no one could answer my question. So I think it is a good place to re-post my question here.
My question:
I found that if you do not include any effective SQL statement between BEGIN/END block, SQL Server 2000 Query Analyzer will think it is an error:
Server: Msg 156, Level 15, State 1, Line 6 Incorrect syntax near the keyword 'end'.
if 1=1 select getdate() else begin --select 'ok' end
Is this behavior a SQL standard or simply a M$ standard glitch?
Was my answer not helpful?
SK
Neo wrote: ......
Can anyone direct me to other newsgroups for this question?
ne***********@msn.com (Neo) wrote in message news:<96**************************@posting.google. com>...
I posted this to microsoft.public.sqlserver.programming, but no one could answer my question. So I think it is a good place to re-post my question here.
My question:
I found that if you do not include any effective SQL statement between BEGIN/END block, SQL Server 2000 Query Analyzer will think it is an error:
Server: Msg 156, Level 15, State 1, Line 6 Incorrect syntax near the keyword 'end'.
if 1=1 select getdate() else begin --select 'ok' end
Is this behavior a SQL standard or simply a M$ standard glitch?
"Neo" <ne***********@msn.com> wrote in message
news:96**************************@posting.google.c om... Is this behavior a SQL standard or simply a M$ standard glitch?
Having this message is not a bad thing as it tends to indicate that your
code is incorrect, rather than the opposite.
John
On Tue, 02 Sep 2003 11:36:27 GMT in comp.databases.ms-sqlserver, Steve
Kass <sk***@drew.edu> wrote: Was my answer not helpful?
Neo wrote: ......
Can anyone direct me to other newsgroups for this question?
or mine?
consider changing:
if @foo=1
set @bar = 2
else
set @bar = 3
to:
if @foo=1
set @bar = 2
else
-- set @bar = 3
you'd get the same sort of error, unless of course some more code
followed that bit in which case you'd just get unexpected results.
--
A)bort, R)etry, I)nfluence with large hammer.
(replace sithlord with trevor for email) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: r.nikhilk |
last post by:
Hi,
Currently, we are porting C++ applications from 32 bit to 64 bit on AIX
platform. (The current version of AIX is 5.3 and xlC verison is 8.0).
We are able to compile the applications by...
|
by: Jim Michaels |
last post by:
C:\prj\quiz\withusers>php tareports.php
PHP Parse error: syntax error, unexpected T_ELSE in
C:\prj\quiz\withusers\tareports.php on line 205
this is the section of code.
if (isset($row4)) {...
|
by: Wescotte |
last post by:
The error message Parse error: syntax error, unexpected $end in FILE on
line X is one I run into frequently and I know the cause is I missed an
ending quote.
Is there an easy way to determine...
|
by: kestrel |
last post by:
I have some html code that is supposed to be displayed by php echo. But for some reason i keep getting a syntax error, and i cant figure out what is going on.
Heres what i have
<?php...
|
by: basswhizz |
last post by:
Hi guys im having trouble with somethings else now can you help out thanks!!
Im getting this error message
Parse error: syntax error, unexpected $end
Here's my code cheers!!]
<?php
//...
|
by: rhys |
last post by:
My Gurus and Angels --
Please pardon this old-school programmer, only recently enlightened to open-source, having been trapped in the convenience of proprietary lingos for way too long. My...
|
by: Jim Michaels |
last post by:
I have a 638 line glob of PHP code & HTML that won't run.
I get "PHP Parse error: syntax error, unexpected '}' in quiz\\quiz.php
on line 594".
I wrote a brace checker that checks perens, square...
|
by: SilvaZodiac |
last post by:
Hi everyone,
I'm still rather new to PHP code, and I have a syntax error. I've tried several different solutions, but it won't fix. It seems to suggest that I need a new bracket somewhere in the...
|
by: paulrajj |
last post by:
hi to all,
i am getting syntax error on my code..
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\xampp\htdocs\Dummy\paulraj\matrim\exam.php on line 62
...
|
by: benicio |
last post by:
Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\wamp\www\study_group\includes\functions.php on line 19
I got this error and this syntax is from 8 to 19th line.
<?php
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |