Which is the query separator in SQL?

jstuardo

New member
Local time
Yesterday, 21:10
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
 
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.
 
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
 
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

Back
Top Bottom