How to get Table Parameters to copy table

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default How to get Table Parameters to copy table

    Hey all,

    I'm trying to do the following in ASP :

    - Determine the parameters(field names and data types) of a
    table .
    - Create a new table with these same parameters.
    - Insert all data from first table into copied table.

    Any suggestions as to what a reliable solution might be for this would
    be appreciated.

    Thanks,

    Joe
    Joe Guest

  2. Similar Questions and Discussions

    1. copy table
      hi , i am using sql create table xxx like aaa including indentity to copy a table , but if table aaa has primary keys specified and xxx has the...
    2. Copy row from table to table
      What is the easiest way to copy a particular row from one table to another (assuming all the columns are exactly the same). I want to maintain a...
    3. Could not load type VTFixup Table from assembly Invalid token in v-table fix-up table.
      We are getting this error after clearing the web.config of database infomation - even after using the wizard to re-enter the information. I could...
    4. Copy data into same table
      I have table Properties. I want to select data for one item and to add that data in same table but for other item (all values would be the...
    5. Copy data from one table to another
      Simon this is very nearly the exact same question you asked in "DTS task" Please do not post the same Q under different headings See my reply...
  3. #2

    Default Re: How to get Table Parameters to copy table

    Joe wrote:
    > Hey all,
    >
    > I'm trying to do the following in ASP :
    >
    > - Determine the parameters(field names and data types) of a
    > table .
    > - Create a new table with these same parameters.
    > - Insert all data from first table into copied table.
    >
    > Any suggestions as to what a reliable solution might be for this would
    > be appreciated.
    >
    > Thanks,
    >
    > Joe
    Why didn't you think your database type and version would be relevant? There
    is no way we can answer this question without that information.


    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows Guest

  4. #3

    Default Re: How to get Table Parameters to copy table

    If you are using SQL Server, take a look at DTS(Data Transformation
    Services).
    If you are using Access, I would use ADOX (but there may be a better way)


    "Joe" <jbassil@cs.dal.ca> wrote in message
    news:a4ac3447.0311270613.2e76d2ef@posting.google.c om...
    > Hey all,
    >
    > I'm trying to do the following in ASP :
    >
    > - Determine the parameters(field names and data types) of a
    > table .
    > - Create a new table with these same parameters.
    > - Insert all data from first table into copied table.
    >
    > Any suggestions as to what a reliable solution might be for this would
    > be appreciated.
    >
    > Thanks,
    >
    > Joe

    TomB Guest

  5. #4

    Default Re: How to get Table Parameters to copy table

    I'm using SQL Server 7, and would like to essentially mimmick the
    functionality of the 'Generate SQL Script' command. I've considered
    using DTS to get me going, but would appreciate your suggestions...

    thanks,
    Joe



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Joe Bassil Guest

  6. #5

    Default Re: How to get Table Parameters to copy table

    If you don't care about indexes and constraints, you can say:

    SELECT * INTO newTable FROM oldTable

    This will create a table with the same structure, and populate it with a
    copy of the existing data.


    "Joe Bassil" <jbassil@cs.dal.ca> wrote in message
    news:eLa6TXPtDHA.2456@TK2MSFTNGP12.phx.gbl...
    > I'm using SQL Server 7, and would like to essentially mimmick the
    > functionality of the 'Generate SQL Script' command. I've considered
    > using DTS to get me going, but would appreciate your suggestions...
    >
    > thanks,
    > Joe
    >
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Foo Man Chew Guest

  7. #6

    Default Re: How to get Table Parameters to copy table

    > If you don't care about indexes and constraints, you can say:
    >
    > SELECT * INTO newTable FROM oldTable
    Just as another disclaimer, this can also cause problems with IDENTITY
    columns, computed columns, primary keys, triggers, defaults (yes, primary
    keys and defaults are constraints, but they deserve individual mention as
    well).

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]


    Aaron Bertrand [MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139