Skip to main content
Participant
May 25, 2010
Question

Dynamic Creation of a Database Using Coldfusion

  • May 25, 2010
  • 1 reply
  • 499 views

Here is what i want to do.

Through the simple click of a button on want to dynamicly create a new databas

e for a completely new user.   I have a database already designed but what i want is for that database to act as my "perfect database image"  that can be replicated for use by other users on the system. I not only need to have  the DB dynamically created or copied I need to be able to create the ODBC connection in coldfusion so that the user can start using the database without any customer service.  I am using MSSQL 2005. thank you.

This topic has been closed for replies.

1 reply

Inspiring
May 27, 2010

1. Create a stored procedure that:

            a. Creates a database exactly like your original design (tables, columns, data types etc)

            b. With required parameters like username, password, dataSource

2. Provide a form for the user to fill (fields to include applicable parameters - password etc)

3. Form action attribute should point to a page that will invoke the stored procedure, passing in all required parameters

4. Build in checks to avoid multiple database creation by one user (except you want to allow it)

5.  It may be better to provide a means for user to delete his/her own database or table