Here is a Database Creation statement I use in production:
CREATE DATABASE empdblive WITH LOG;
That will create a database with a logging. If you want to create a database with no logging just use
CREATE DATABASE empdblive;
Once you have created the database, you may want to create tables in it. I usually create a single script that creates my entire schema, stored procedures, and triggers, so that if I want to recreate a database, I just use that one script.
the following script will create a database and a single table in it.
-----Creating the database
CREATE DATABASE empdblive WITH LOG;
DATABASE empdblive; -- making the new database the active database
CREATE TABLE tblemployee(
emp_key integer,
last_name char(30) not null,
first_name char(30) not null,
middle_name char(30) not null,
emp_type smallint,
department integer)
IN dbspace1 (or whatever your db space is called)
EXTENT SIZE 30554
NEXT SIZE 30554
LOCK MODE ROW;
It is possible to even create stored procedures and triggers in the same script to create a fully operational database in one fell swoop! :-)
Main Topics
Browse All Topics





by: qz8dswPosted on 2007-08-07 at 11:56:27ID: 19648666
Using the create database command should do it.
com/infoce nter/idshe lp/v10/ ind ex.jsp?top ic=/com.ib m.ddi.doc/ ddi73.htm
http://publib.boulder.ibm.
Terry