[thelist] MS Access CREATE TABLE

Ken Schaefer ken at adOpenStatic.com
Wed Jan 7 17:09:39 CST 2004


I meant, this is easy to do with SQL Server 2000's Query Analyser and an SQL
Server database. And that the OP was looking for a way to replicate this
functionality against a Jet .mdb database.

Sorry for the confusion.

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Anthony Johnston" <tech at antix.co.uk>
Subject: RE: [thelist] MS Access CREATE TABLE


: Hi Ken,  how do you get the Query Analyzer to work with Access?
:
: Ant
:
: -----Original Message-----
: From: thelist-bounces at lists.evolt.org
: [mailto:thelist-bounces at lists.evolt.org] On Behalf Of Ken Schaefer
: Sent: 07 January 2004 11:42
: To: thelist at lists.evolt.org
: Subject: Re: [thelist] MS Access CREATE TABLE
:
: I think Dave has an existing database, and he wants to generate the CREATE
: TABLE scripts from the existing database's schema.
:
: With the SQL Server 2000 Query Analyser this is easy to do - right click
on
: a table in the object browser and choose "script as new", or "script as
: alter", and you get the requisite CREATE or ALTER table statements
: autogenerated for you.
:
: Cheers
: Ken
:
:
: ----- Original Message -----
: From: "Anthony Johnston" <tech at antix.co.uk>
: To: <thelist at lists.evolt.org>
: Sent: Wednesday, January 07, 2004 9:05 PM
: Subject: RE: [thelist] MS Access CREATE TABLE
:
:
: : I do this a lot,  however it is not well documented and a lot of hastle
: :
: : Create a schema (example below),  and then run it through another
program
: : which executes it line by line using JET.  It has some limitations in
that
: : you cannot set all the properties of a field using this method such as
: : 'allow zero length'.
: :
: : It would be better for you in the long run to migrate to MS SQL Server
or
: : MySQL.
: :
: : Ant.
: :
:
: --------------------------------------------------------------------------
: -
: :
: : Example Script,  this can be executed through JET (Execute at each ;)
: :
: : CREATE TABLE sys_tu_user(
: : sys_u_id TEXT(25) NOT NULL,
: : sys_u_created DATETIME NULL,
: : sys_u_super TINYINT DEFAULT 0 NOT NULL,
: : sys_lock TEXT(25) DEFAULT "",
: : sys_updated TIMESTAMP NULL,
: : CONSTRAINT sys_iu_primaryKey PRIMARY KEY(sys_u_id));
: :
: : CREATE TABLE sys_ts_session(
: : sys_s_id AUTOINCREMENT,
: : sys_u_user TEXT (25) NOT NULL,
: : sys_s_started DATETIME NOT NULL,
: : sys_s_ended DATETIME NOT NULL,
: : sys_s_referer TEXT(250) NOT NULL,
: : sys_s_headers TEXT NOT NULL,
: : sys_s_browser TEXT(100) NOT NULL,
: : CONSTRAINT g_iu_primaryKey PRIMARY KEY(sys_s_id));
: :
: : CREATE TABLE sys_tsP_sessionPage(
: : sys_sP_id AUTOINCREMENT,
: : sys_s_session INT NOT NULL,
: : sys_sP_page TEXT(100) NOT NULL,
: : sys_sP_queryString TEXT(250) NOT NULL,
: : sys_sP_dateTime DATETIME NOT NULL,
: : CONSTRAINT sys_rs_session FOREIGN KEY (sys_s_session) REFERENCES
: : sys_ts_session (sys_s_id),
: : CONSTRAINT g_iu_primaryKey PRIMARY KEY(sys_sP_id));



More information about the thelist mailing list