Symptom
- 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
Example:
if not exists (select 1 from sysobjects
where name = "mytable")
begin
create table mytable (c1 int)
end
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"))
begin
alter table mytable add c1 int
end
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.
Read more...
Environment
- SAP Adaptive Server Enterprise (ASE) all versions
- SAP Adaptive Server Enterprise Cluster Edition (ASE CE) all versions
Product
Keywords
sybase , KBA , BC-SYB-ASE , Sybase ASE Database Platform (non Business Suite) , BC-SYB-ASE-CE , ASE Cluster Edition (Standalone) , Problem
About this page
This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).Search for additional results
Visit SAP Support Portal's SAP Notes and KBA Search.