In a code module, I want to make a copy of a table, with the structure only containing no data. Will someone kindly provide a code sample of how to do it?
The only disadvantage of this method is that it won't copy the primary or foreign keys, referential integrity, field or table properties (eg descriptions, validation rules) across.
In Query Analyser, why don't you open up the object browser, right click the table that you want to use as a template, select Script Object to clipboard > create. Paste it wherever and just change the Table name. That way you get all the PK's and indexes that the parent table too.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.