Which is the query separator in SQL? (1 Viewer)

jstuardo

New member
Local time
Today, 12:16
Joined
Jan 17, 2010
Messages
2
Hello...

I want to create MS Access 2003 tables programmatically using ADO.NET. If I have:

Code:
create table ADMINISTRADOR
(
AdmId AUTOINCREMENT not null,
RolId INTEGER not null,
AdmNombres TEXT(100) not null,
AdmApellidos TEXT(100) not null,
AdmTelefono TEXT(30),
AdmLogin TEXT(20) not null,
AdmPassword TEXT(32) not null,
AdmIdentificacion TEXT(30),
AdmFechaUltimaConexion DATETIME,
AdmFechaCreacion DATETIME not null,
AdmFechaModificacion DATETIME,
AdmEliminado YESNO not null,
constraint PK_ADMINISTRADOR primary key (AdmId)
);
create table BIOPLANTILLA
(
PlaId AUTOINCREMENT not null,
PerId INTEGER not null,
PlaPlugin TEXT(20) not null,
PlaTipo TEXT(10),
PlaDatos OLEOBJECT,
PlaFechaCreacion DATETIME not null,
PlaFechaModificacion DATETIME,
PlaEliminado YESNO not null,
constraint PK_BIOPLANTILLA primary key (PlaId)
);

a "Syntax error in CREATE TABLE statement." is shown.

If I run each CREATE TABLE separately, it works, so I guess that the ";" that separate each statement is incorrect.

How can I do it?

Thanks
Jaime
 

Banana

split with a cherry atop.
Local time
Today, 12:16
Joined
Sep 1, 2005
Messages
6,318
The semicolon ( ; ) is the separator, but the real issue is that JET/ACT does not support multiple statements. You must execute each single statement at a single time.
 

jstuardo

New member
Local time
Today, 12:16
Joined
Jan 17, 2010
Messages
2
Banana, thanks for answering. In fact, I'm using Microsoft.Jet.OLEDB.4.0 provider in connection string. Is there another provider that allows multiple statement to be executed at a time?

Cheers
Jaime
 

Banana

split with a cherry atop.
Local time
Today, 12:16
Joined
Sep 1, 2005
Messages
6,318
Not that I know of, sorry.
 

Banana

split with a cherry atop.
Local time
Today, 12:16
Joined
Sep 1, 2005
Messages
6,318
Wait, I just lied.

I just remembered that there is a console application... JetSQL that supports multiple statements by using a batch file. This is not really the thing as we're looking at but that's an option...
 

Users who are viewing this thread

Top Bottom