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

  1. #1

    Default ASP - SQL

    I have a web site running on IIS 5.0. I have a few asp pages using a SQL
    database. The database is equipment. It has three table in it. used, new,
    sold. I have pages that display the records and also edit the records.

    I want to creat a page that will move a record from the used table to the
    sold table when that piece of equipment is in fact sold. Is this possible?

    As of now I go into the sql dtatbase and copy the record to the correct
    table and then delete it from the old table. Thanks!

    Darren
    MCP


    Darren Woodbrey Guest

  2. #2

    Default Re: ASP - SQL

    One option is to redo the DB and just have one table with the items, and add
    a column for the state of the item, used, new, sold. Like, a numeric column
    where 1 = new, 2 = used, and 3 = sold, or something along those lines.

    If you want to leave things as they are, what you'd do is grab the values
    for the item in the "used" table, insert them into the "sold" table, and
    then delete the record from the "used" table. You'd want to do this as a
    transaction to avoid losing an item if there's a failure.

    Ray at work

    "Darren Woodbrey" <darrenwoodbrey@hpfairfield.com> wrote in message
    news:Ox2hfBvoDHA.2244@TK2MSFTNGP12.phx.gbl...
    > I have a web site running on IIS 5.0. I have a few asp pages using a SQL
    > database. The database is equipment. It has three table in it. used,
    new,
    > sold. I have pages that display the records and also edit the records.
    >
    > I want to creat a page that will move a record from the used table to the
    > sold table when that piece of equipment is in fact sold. Is this
    possible?
    >
    > As of now I go into the sql dtatbase and copy the record to the correct
    > table and then delete it from the old table. Thanks!
    >
    > Darren
    > MCP
    >
    >

    Ray at Guest

  3. #3

    Default Re: ASP - SQL

    Wouldn't it be better to have one table for equipment - I assume the three
    you have now are indentical - with a column indicating equipment status -
    N(ew), U(sed), S(old) - and just change that?

    Otherwise....

    insert sold (field1, field2,....) values (select field1,field2 from used
    where id=used_id)
    delete used where id=used_id

    You would need to wrap this in a transaction to make sure both queries have
    executed properly.


    Bob Lehmann

    "Darren Woodbrey" <darrenwoodbrey@hpfairfield.com> wrote in message
    news:Ox2hfBvoDHA.2244@TK2MSFTNGP12.phx.gbl...
    > I have a web site running on IIS 5.0. I have a few asp pages using a SQL
    > database. The database is equipment. It has three table in it. used,
    new,
    > sold. I have pages that display the records and also edit the records.
    >
    > I want to creat a page that will move a record from the used table to the
    > sold table when that piece of equipment is in fact sold. Is this
    possible?
    >
    > As of now I go into the sql dtatbase and copy the record to the correct
    > table and then delete it from the old table. Thanks!
    >
    > Darren
    > MCP
    >
    >

    Bob Lehmann 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