Not supplied by Sybase. But as I described in my book "Tips, Tricks &
Recipes for Sybase ASE" (www.sypron.nl/ttr) you can use
execute-immediate to perform such a check. Create a procedure like
this:
create proc p
@cmd varchar(100)
as
exec(@cmd)
if @@error != 0
print "Syntax invalid"
else
print "Syntax valid"
go
This will work for most T-SQL statements. Some statements, like exec()
itself, dbcc commands, and a few others, cannot be executed inside
exec() so it would seem to be invalid syntax even though it's actually
correct (this is because exec() wasn't intended to be used this way).
You can optionally suppress the 'error message output with 'set
background' as described in my book (see page 19). However, I strongly
recommend not doing this unless you're aware of the sharp edges of
this command (described in detail in my book).
HTH,
Rob V.
-------------------------------------------------------------
Rob Verschoor
Certified Sybase Professional DBA for ASE 12.5/12.0/11.5/11.0
and Replication Server 12.5
Author of "Tips, Tricks & Recipes for Sybase ASE" and
"The Complete Sybase ASE Quick Reference Guide"
Online orders accepted at http://www.sypron.nl/shop
mailto:r...@YOUR.SPAM.sypron.nl.NOT.FOR.ME
http://www.sypron.nl
Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands
-------------------------------------------------------------
On 19 Feb 2004 23:01:35 -0800,
in sybase.public.ase.general
HTH,
Rob V.
"Name" <na...@somewhere.com> wrote in message
news:403615c0$1@forums-2-dub...