With TableSmart custom tag you can write your script initially installing tables on clean database or checking existing data structures like this: <CF_TABLESMART ds="#curds#" dbt="#curdbt#" table="customer" fields=" customerid int IDENTITY (1,1) NOT NULL PRIMARY KEY, prefix nvarchar (5) NULL, firstname nvarchar (30) NULL, middlename varchar (20) NULL, lastname nvarchar (30) NULL, birthdate datetime NULL, companyorg nvarchar (150) NULL, address1 nvarchar (40) NULL, address2 nvarchar (40) NULL, cityid int not NULL default(0), postalcode nvarchar (15) NULL, homephone nvarchar (25) NULL, workphone nvarchar (25) NULL, fax nvarchar (25) NULL, email nvarchar (60) NULL, email2 varchar(60) NULL, wemail nvarchar (60) NULL, custusername varchar (50) NULL, custpassword varchar (20) NULL, ipaddress varchar (15) NULL, gender nchar (1) NULL, title nvarchar (200) NULL, maincontactid int not NULL default(0), excludefrombatch bit not null default(0), customernotes text NULL, updated datetime NULL, lastcontacted datetime null, inactive bit NOT NULL default(0)" indexes=" email custusername custpassword cityid countryid">
what is as short and clear as possible. It is actually possible just copy and paste code generated by SQL Query Analyzer (in case of SQL Server database). When launched, TableSmart custom tag will check every field, constraint and index, will create them if missing and will try to correct table structure if possible in case of database is not clean. But only safe action can be performed so existing data can not be changed in any way. |
| BRIEF DESCRIPTION: CF-Works: coldfusion custom tags, open source, custom tag, install tables,installing database,installing tables,create tables,creating tables,coldfusion examples,create indexes,coldfusion open source |