Link to home
Create AccountLog in
Avatar of donhannam
donhannamFlag for New Zealand

asked on

MSSQL - Copy file structure of 40 new tables to an existing database - create file

I am developing an application for an existing database and want to reguarily add new tables to the database. I can copy the files and contents easy enough but would like to set up an empty table with indexs set to zero etc.

I have gone into each table on management studio and created a script to create each table and set up one long sql statement to create all of the tables.

Is there a quicker way to do this.
Avatar of chapmandew
chapmandew
Flag of United States of America image

If you are using 2005, you can setup DDL triggers to capture the statements that create the tables...then just run them on the other server using SSIS or some other tool..

DDL triggers:

http://www.builderau.com.au/architect/print.htm?TYPE=story&AT=339252022-339024564t-320000007c
Avatar of donhannam

ASKER

Thanks - I think this is designed to record the building of the files and then use this as a routine to create files.

I was hoping to be able to create the table in the database using a files that have evolved over a period of time. _ looking for a simple way to transfer files without data or build series of create table statements without manually going to each file and using create utility.
ASKER CERTIFIED SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Thanks thats what I was after - you've saved me a heap of time.