- SQL contains an IF clause that conditionally executes a Data Definition Language (DDL) command (CREATE, ALTER, or DROP)
- ASE raises an error as if it executed the DDL command even though the IF clause was not true
if not exists (select 1 from sysobjects
where name = "mytable")
create table mytable (c1 int)
Msg 2714, Level 16, State 1:
Server 'SYBASE', Line 3:
There is already an object named 'mytable' in the database.
if not exists (select 1 from syscolumns
where name = "c1"
and id = object_id("mytable"))
alter table mytable add c1 int
Msg 2705, Level 16, State 3:
Server 'SYBASE', Line 5:
Column names in each table must be unique. Column name 'c1' in table 'mytable'
is specified more than once.
- SAP Adaptive Server Enterprise (ASE) all versions
- SAP Adaptive Server Enterprise Cluster Edition (ASE CE) all versions
sybase , KBA , BC-SYB-ASE , Sybase ASE Database Platform (non Business Suite) , BC-SYB-ASE-CE , ASE Cluster Edition (Standalone) , Problem
About this pageThis is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).
Search for additional results
Visit SAP Support Portal's SAP Notes and KBA Search.