Ask a Question related to ASP Database, Design and Development.
-
Darren Woodbrey #1
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
-
Ray at #2
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...new,> 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,possible?> 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>
> 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
-
Bob Lehmann #3
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...new,> 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,possible?> 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>
> 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



Reply With Quote

