on ‎2012 May 14 6:22 PM
Hi, I am looking at this too many hours again. In Microsoft SQL via vb6 front end.
I use: db.Execute "if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BuildFileAllOthersCDC]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)" & _ "drop table [dbo].[BuildFileAllOthersCDC]"
In Sybase with the same VB program. I am trying to use: myConnTM.Execute "if exists (select * from sysobjects where name=" 'mytable' " = 1) drop table 'mytable'"
I have tried all froms of this, all I can think of, does the "if exists" work with SYBASE SQL? I get an error, "Syntax error near if line one" Will trade gray hairs for suggestions... smile
George
Request clarification before answering.
What version of SQL Anywhere are you using?
Version 11.0.1 and above support the "DROP TABLE IF EXISTS MyTable" syntax, by this omitting the need to check beforehand if the table already exists.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.