Home Page link  

Delete inactive items

 

Point-Of-Sale Software - - MS Point Of Sale software discussed here 

get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content  add this group's latest topics to your Google content  YahooMyWeb Yahoo!  Google Google  Windows Live Favorites Windows Live  del.icio.us del.icio.us  digg digg  Add to Netscape Netscape
Subject Author Date
Delete inactive items geokar 11-03-2006
Posted by Jeff @ Check Point Software on November 7, 2006, 4:30 pm
Please log in for more thread options
: quoted-printable

Geokar,

Again, this routine will leave orphaned records. This will only delete =
the entries in the Item database, it will not delete any Supplier's =
numbers or Alias' for starters.

You're better off, if you _really_ want to delete them, to do it though =
the program!

--=20

Jeff=20
Check Point Software

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D

You must be using Outlook Express or some other type of newsgroup reader =
to
see and download the file attachment(s). If you are not using a reader, =
follow
the link below to setup Outlook Express. Click on "Open with =
newsreader"
under the MS Retail Management System on the right.

http://tinyurl.com/75bgz
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D

hi,

normal procedure..before running any update or delete query, back up =
your=20
data..

this is the query to delete inactive items

* I assume that you have updated/set your item into inactive
---------------------------------------------
delete from item where inactive=3D1
---------------------------------------------
or if you want to delete 2000 year old data you can use this
---------------------------------------------
delete from item where (item.lastupdated <=3D CONVERT(DATETIME, =
'2001-01-01=20
00:00:00', 102))
--------------------------------------------

Run this query after backup is made successfully.

Good Luck

"geokar" wrote:

> Great,
> Now how about deleting inactive items?
>=20
> "jocelyn" wrote:
>=20
> > OK, here is your delete qty query from SO Admin:
> >=20
> > *Backup first*
> >=20
> > UPDATE Item SET Quantity =3D 0
> >=20
> > I would also back report this one in HQ Mgr.
> >=20
> >=20
> >=20
> >=20
> >=20
> > "geokar" wrote:
> >=20
> > > Hi,
> > >=20
> > > Can someone please give me a SQL Query make all On Hand =
quantities zero and=20
> > > to delete all Inactive items? I am opening a new store and have =
copied my=20
> > > database to the new location, but I don't think it's necessary =
to keep 3 year=20
> > > old items on file.
------=_NextPart_000_030C_01C70270.F2337600
Content-Type: text/html;
        charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8">
<META content=3D"MSHTML 6.00.5730.11" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#008000>Geokar,</FONT></DIV>
<DIV><FONT color=3D#008000></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#008000>Again, this routine will leave orphaned =
records.&nbsp;=20
This will only delete the entries in the Item database, it will not =
delete any=20
Supplier's numbers or Alias' for starters.</FONT></DIV>
<DIV><FONT color=3D#008000></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#008000>You're better off, if you _really_ want to =
delete them,=20
to do it though the program!</FONT></DIV>
<DIV><BR>-- <BR><BR>Jeff <BR>Check Point Software</DIV>
<DIV>&nbsp;</DIV>
<DIV>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D</DIV>
<DIV>&nbsp;</DIV>
<DIV>You must be using Outlook Express or some other type of newsgroup =
reader=20
to<BR>see and download the file attachment(s).&nbsp; If you are not =
using a=20
reader, follow<BR>the link below to setup Outlook Express.&nbsp; Click =
on "Open=20
with newsreader"<BR>under the MS Retail Management System on the =
right.</DIV>
<DIV>&nbsp;</DIV>
<DIV><A=20
href=3D"http://tinyurl.com/75bgz">http://tinyurl.com/75bgz</A><BR>=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
<BR></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #008000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"GregDxb" &lt;<A=20
=
rosoft.com</A>&gt;=20
wrote in message <A=20
=
1D3D2-CE0F-4833-A39B-08110D7112CF@microsoft.com</A>...</DIV>hi,<BR><BR>no=
rmal=20
procedure..before running any update or delete query, back up your=20
<BR>data..<BR><BR>this is the query to delete inactive items<BR><BR>* =
I assume=20
that you have updated/set your item into=20
inactive<BR>---------------------------------------------<BR>delete =
from item=20
where =
inactive=3D1<BR>---------------------------------------------<BR>or if =
you=20
want to delete 2000 year old data you can use=20
this<BR>---------------------------------------------<BR>delete from =
item=20
where (item.lastupdated &lt;=3D CONVERT(DATETIME, '2001-01-01 =
<BR>00:00:00',=20
102))<BR>--------------------------------------------<BR><BR>Run this =
query=20
after backup is made successfully.<BR><BR>Good Luck<BR><BR>"geokar"=20
wrote:<BR><BR>&gt; Great,<BR>&gt; Now how about deleting inactive=20
items?<BR>&gt; <BR>&gt; "jocelyn" wrote:<BR>&gt; <BR>&gt; &gt; OK, =
here is=20
your delete qty query from SO Admin:<BR>&gt; &gt; <BR>&gt; &gt; =
*Backup=20
first*<BR>&gt; &gt; <BR>&gt; &gt; UPDATE Item SET Quantity =3D =
0<BR>&gt; &gt;=20
<BR>&gt; &gt; I would also back report this one in HQ Mgr.<BR>&gt; =
&gt;=20
<BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; =
"geokar"=20
wrote:<BR>&gt; &gt; <BR>&gt; &gt; &gt; Hi,<BR>&gt; &gt; &gt; <BR>&gt; =
&gt;=20
&gt; Can someone please give me a SQL Query make all On Hand =
quantities zero=20
and <BR>&gt; &gt; &gt; to delete all Inactive items?&nbsp; I am =
opening a new=20
store and have copied my <BR>&gt; &gt; &gt; database to the new =
location, but=20
I don't think it's necessary to keep 3 year <BR>&gt; &gt; &gt; old =
items on=20
file.</BLOCKQUOTE></BODY></HTML>

------=
Posted by GregDxb on November 8, 2006, 12:08 am
Please log in for more thread options
Good Point jeff,

I forgot the alias table :)
---delete first the alias---
delete from alias where itemid in (select id from item where inactive=1)
---then delete the item---
delete from item where inactive=1

this is just a solution of what you want.. This is just a practical solution
to delete n # of records rather than going to your records n times depends on
how many inactive you want to delete.


"Jeff @ Check Point Software" wrote:

> Geokar,
>
> Again, this routine will leave orphaned records. This will only delete the
entries in the Item database, it will not delete any Supplier's numbers or
Alias' for starters.

>
> You're better off, if you _really_ want to delete them, to do it though the
program!
>
> --
>
> Jeff
> Check Point Software
>
> =====================================================
>
> You must be using Outlook Express or some other type of newsgroup reader to
> see and download the file attachment(s). If you are not using a reader, follow
> the link below to setup Outlook Express. Click on "Open with newsreader"
> under the MS Retail Management System on the right.
>
> http://tinyurl.com/75bgz
> =====================================================
>
> hi,
>
> normal procedure..before running any update or delete query, back up your
> data..
>
> this is the query to delete inactive items
>
> * I assume that you have updated/set your item into inactive
> ---------------------------------------------
> delete from item where inactive=1
> ---------------------------------------------
> or if you want to delete 2000 year old data you can use this
> ---------------------------------------------
> delete from item where (item.lastupdated <= CONVERT(DATETIME, '2001-01-01
> 00:00:00', 102))
> --------------------------------------------
>
> Run this query after backup is made successfully.
>
> Good Luck
>
> "geokar" wrote:
>
> > Great,
> > Now how about deleting inactive items?
> >
> > "jocelyn" wrote:
> >
> > > OK, here is your delete qty query from SO Admin:
> > >
> > > *Backup first*
> > >
> > > UPDATE Item SET Quantity = 0
> > >
> > > I would also back report this one in HQ Mgr.
> > >
> > >
> > >
> > >
> > >
> > > "geokar" wrote:
> > >
> > > > Hi,
> > > >
> > > > Can someone please give me a SQL Query make all On Hand quantities
zero and
> > > > to delete all Inactive items? I am opening a new store and have
copied my
> > > > database to the new location, but I don't think it's necessary to keep
3 year
> > > > old items on file

Posted by Database Badger on November 8, 2006, 3:49 pm
Please log in for more thread options
You're missing a table. You need to clear the entry for the inactive item
from the supplierlist table as well. Otherwise you will have orphaned
records in the supplierlist table.

Backup your database first!

delete from alias where itemid in (select id from item where inactive=1)
delete from supplierlist where itemid in (select id from item where
inactive=1)
delete from item where inactive=1

If you are in an HQ environment you will also need to delete the records out
of the itemdynamic table as well as the 3 tables above. The ItemDynamic
table is not present in SO databases.
So for HQ databases:
Backup Database!

delete from alias where itemid in (select id from item where inactive=1)
delete from supplierlist where itemid in (select id from item where
inactive=1)
delete from itemdynamic where itemid in (select id from item where inactive=1)
delete from item where inactive=1




"GregDxb" wrote:

> Good Point jeff,
>
> I forgot the alias table :)
> ---delete first the alias---
> delete from alias where itemid in (select id from item where inactive=1)
> ---then delete the item---
> delete from item where inactive=1
>
> this is just a solution of what you want.. This is just a practical solution
> to delete n # of records rather than going to your records n times depends on
> how many inactive you want to delete.
>
>
> "Jeff @ Check Point Software" wrote:
>
> > Geokar,
> >
> > Again, this routine will leave orphaned records. This will only delete the
entries in the Item database, it will not delete any Supplier's numbers or
Alias' for starters.

> >
> > You're better off, if you _really_ want to delete them, to do it though the
program!
> >
> > --
> >
> > Jeff
> > Check Point Software
> >
> > =====================================================
> >
> > You must be using Outlook Express or some other type of newsgroup reader to
> > see and download the file attachment(s). If you are not using a reader,
follow
> > the link below to setup Outlook Express. Click on "Open with newsreader"
> > under the MS Retail Management System on the right.
> >
> > http://tinyurl.com/75bgz
> > =====================================================
> >
> > hi,
> >
> > normal procedure..before running any update or delete query, back up your
> > data..
> >
> > this is the query to delete inactive items
> >
> > * I assume that you have updated/set your item into inactive
> > ---------------------------------------------
> > delete from item where inactive=1
> > ---------------------------------------------
> > or if you want to delete 2000 year old data you can use this
> > ---------------------------------------------
> > delete from item where (item.lastupdated <= CONVERT(DATETIME, '2001-01-01
> > 00:00:00', 102))
> > --------------------------------------------
> >
> > Run this query after backup is made successfully.
> >
> > Good Luck
> >
> > "geokar" wrote:
> >
> > > Great,
> > > Now how about deleting inactive items?
> > >
> > > "jocelyn" wrote:
> > >
> > > > OK, here is your delete qty query from SO Admin:
> > > >
> > > > *Backup first*
> > > >
> > > > UPDATE Item SET Quantity = 0
> > > >
> > > > I would also back report this one in HQ Mgr.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > "geokar" wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > Can someone please give me a SQL Query make all On Hand quantities
zero and
> > > > > to delete all Inactive items? I am opening a new store and have
copied my
> > > > > database to the new location, but I don't think it's necessary to
keep 3 year
> > > > > old items on file

Posted by Jeff @ Check Point Software on November 8, 2006, 9:15 pm
Please log in for more thread options
: quoted-printable

Geokar, GregDXB, Jocelyn, Database, and whoever else has the stupid idea =
to do this,

Yeah, that would delete some more of the orphaned records, now how about =
the orphans here in these tables;

ItemClassComponent
InventoryOffline
InventoryTransferLog
Kit
LimitEntry
PurchaseOrderEntry
Serial
TransactionHoldEntry

and there maybe even more cuz I didn't look very hard. ;-)


************************************************

AGAIN, MY POINT IS THAT YOU SHOULDN'T BE DELETING ITEMS THIS WAY. DO IT =
THROUGH THE RMS PROGRAM!!!!!!

*************************************************

--=20

Jeff=20
Check Point Software

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D

You must be using Outlook Express or some other type of newsgroup reader =
to
see and download the file attachment(s). If you are not using a reader, =
follow
the link below to setup Outlook Express. Click on "Open with =
newsreader"
under the MS Retail Management System on the right.

http://tinyurl.com/75bgz
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D

You're missing a table. You need to clear the entry for the inactive =
item=20
from the supplierlist table as well. Otherwise you will have orphaned =

records in the supplierlist table.

Backup your database first!

delete from alias where itemid in (select id from item where =
inactive=3D1)
delete from supplierlist where itemid in (select id from item where=20
inactive=3D1)
delete from item where inactive=3D1

If you are in an HQ environment you will also need to delete the =
records out=20
of the itemdynamic table as well as the 3 tables above. The =
ItemDynamic=20
table is not present in SO databases.
So for HQ databases:
Backup Database!

delete from alias where itemid in (select id from item where =
inactive=3D1)
delete from supplierlist where itemid in (select id from item where=20
inactive=3D1)
delete from itemdynamic where itemid in (select id from item where =
inactive=3D1)
delete from item where inactive=3D1




"GregDxb" wrote:

> Good Point jeff,
>=20
> I forgot the alias table :)
> ---delete first the alias---
> delete from alias where itemid in (select id from item where =
inactive=3D1)
> ---then delete the item---
> delete from item where inactive=3D1
>=20
> this is just a solution of what you want.. This is just a practical =
solution=20
> to delete n # of records rather than going to your records n times =
depends on=20
> how many inactive you want to delete.
>=20
>=20
> "Jeff @ Check Point Software" wrote:
>=20
> > Geokar,
> >=20
> > Again, this routine will leave orphaned records. This will only =
delete the entries in the Item database, it will not delete any =
Supplier's numbers or Alias' for starters.
> >=20
> > You're better off, if you _really_ want to delete them, to do it =
though the program!
> >=20
> > --=20
> >=20
> > Jeff=20
> > Check Point Software
> >=20
> > =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> >=20
> > You must be using Outlook Express or some other type of newsgroup =
reader to
> > see and download the file attachment(s). If you are not using a =
reader, follow
> > the link below to setup Outlook Express. Click on "Open with =
newsreader"
> > under the MS Retail Management System on the right.
> >=20
> > http://tinyurl.com/75bgz
> > =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> >=20
> > hi,
> >=20
> > normal procedure..before running any update or delete query, =
back up your=20
> > data..
> >=20
> > this is the query to delete inactive items
> >=20
> > * I assume that you have updated/set your item into inactive
> > ---------------------------------------------
> > delete from item where inactive=3D1
> > ---------------------------------------------
> > or if you want to delete 2000 year old data you can use this
> > ---------------------------------------------
> > delete from item where (item.lastupdated <=3D CONVERT(DATETIME, =
'2001-01-01=20
> > 00:00:00', 102))
> > --------------------------------------------
> >=20
> > Run this query after backup is made successfully.
> >=20
> > Good Luck
> >=20
> > "geokar" wrote:
> >=20
> > > Great,
> > > Now how about deleting inactive items?
> > >=20
> > > "jocelyn" wrote:
> > >=20
> > > > OK, here is your delete qty query from SO Admin:
> > > >=20
> > > > *Backup first*
> > > >=20
> > > > UPDATE Item SET Quantity =3D 0
> > > >=20
> > > > I would also back report this one in HQ Mgr.
> > > >=20
> > > >=20
> > > >=20
> > > >=20
> > > >=20
> > > > "geokar" wrote:
> > > >=20
> > > > > Hi,
> > > > >=20
> > > > > Can someone please give me a SQL Query make all On Hand =
quantities zero and=20
> > > > > to delete all Inactive items? I am opening a new store =
and have copied my=20
> > > > > database to the new location, but I don't think it's =
necessary to keep 3 year=20
> > > > > old items on file
------=_NextPart_000_078F_01C70361.E7D22B10
Content-Type: text/html;
        charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8">
<META content=3D"MSHTML 6.00.5730.11" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#008000>Geokar, GregDXB, Jocelyn, Database, and =
whoever else=20
has the stupid idea to do this,</FONT></DIV>
<DIV><FONT color=3D#008000></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#008000>Yeah, that would delete some more of the =
orphaned=20
records, now how about the orphans here in these tables;</FONT></DIV>
<DIV><FONT color=3D#008000></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#008000>ItemClassComponent</FONT></DIV>
<DIV><FONT color=3D#008000>InventoryOffline</FONT></DIV>
<DIV><FONT color=3D#008000>InventoryTransferLog</FONT></DIV>
<DIV><FONT color=3D#008000>Kit</FONT></DIV>
<DIV><FONT color=3D#008000>LimitEntry</FONT></DIV>
<DIV><FONT color=3D#008000>PurchaseOrderEntry</FONT></DIV>
<DIV><FONT color=3D#008000>Serial</FONT></DIV>
<DIV><FONT color=3D#008000>TransactionHoldEntry</FONT></DIV>
<DIV><FONT color=3D#008000></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#008000>and there maybe even more cuz I didn't look =
very hard.=20
;-)</FONT></DIV>
<DIV><FONT color=3D#008000></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#008000></FONT>&nbsp;</DIV>
<DIV><FONT=20
color=3D#008000>************************************************</FONT></=
DIV>
<DIV><FONT color=3D#008000></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#008000>AGAIN, MY POINT IS THAT YOU SHOULDN'T BE =
DELETING ITEMS=20
THIS WAY.&nbsp; DO IT THROUGH THE RMS PROGRAM!!!!!!</FONT></DIV>
<DIV><FONT color=3D#008000></FONT>&nbsp;</DIV>
<DIV><FONT=20
color=3D#008000>*************************************************</FONT><=
/DIV>
<DIV><BR>-- <BR><BR>Jeff <BR>Check Point Software</DIV>
<DIV>&nbsp;</DIV>
<DIV>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D</DIV>
<DIV>&nbsp;</DIV>
<DIV>You must be using Outlook Express or some other type of newsgroup =
reader=20
to<BR>see and download the file attachment(s).&nbsp; If you are not =
using a=20
reader, follow<BR>the link below to setup Outlook Express.&nbsp; Click =
on "Open=20
with newsreader"<BR>under the MS Retail Management System on the =
right.</DIV>
<DIV>&nbsp;</DIV>
<DIV><A=20
href=3D"http://tinyurl.com/75bgz">http://tinyurl.com/75bgz</A><BR>=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
<BR></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #008000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Database Badger" &lt;Database <A=20
=
soft.com</A>&gt;=20
wrote in message <A=20
=
B3A7E-3D70-4BA2-8243-0E162326D55F@microsoft.com</A>...</DIV>You're=20
missing a table.&nbsp; You need to clear the entry for the inactive =
item=20
<BR>from the supplierlist table as well.&nbsp; Otherwise you will have =

orphaned <BR>records in the supplierlist table.<BR><BR>Backup your =
database=20
first!<BR><BR>delete from alias where itemid in (select id from item =
where=20
inactive=3D1)<BR>delete from supplierlist where itemid in (select id =
from item=20
where <BR>inactive=3D1)<BR>delete from item where =
inactive=3D1<BR><BR>If you are=20
in an HQ environment you will also need to delete the records out =
<BR>of the=20
itemdynamic table as well as the 3 tables above.&nbsp; The ItemDynamic =

<BR>table is not present in SO databases.<BR>So for HQ =
databases:<BR>Backup=20
Database!<BR><BR>delete from alias where itemid in (select id from =
item where=20
inactive=3D1)<BR>delete from supplierlist where itemid in (select id =
from item=20
where <BR>inactive=3D1)<BR>delete from itemdynamic where itemid in =
(select id=20
from item where inactive=3D1)<BR>delete from item where=20
inactive=3D1<BR><BR><BR><BR><BR>"GregDxb" wrote:<BR><BR>&gt; Good =
Point=20
jeff,<BR>&gt; <BR>&gt; I forgot the alias table :)<BR>&gt; ---delete =
first the=20
alias---<BR>&gt; delete from alias where itemid in (select id from =
item where=20
inactive=3D1)<BR>&gt; ---then delete the item---<BR>&gt; delete from =
item where=20
inactive=3D1<BR>&gt; <BR>&gt; this is just a solution of what you =
want.. This is=20
just a practical solution <BR>&gt; to delete n # of records rather =
than going=20
to your records n times depends on <BR>&gt; how many inactive you want =
to=20
delete.<BR>&gt; <BR>&gt; <BR>&gt; "Jeff @ Check Point Software" =
wrote:<BR>&gt;=20
<BR>&gt; &gt; Geokar,<BR>&gt; &gt; <BR>&gt; &gt; Again, this routine =
will=20
leave orphaned records.&nbsp; This will only delete the entries in the =
Item=20
database, it will not delete any Supplier's numbers or Alias' for=20
starters.<BR>&gt; &gt; <BR>&gt; &gt; You're better off, if you =
_really_ want=20
to delete them, to do it though the program!<BR>&gt; &gt; <BR>&gt; =
&gt; --=20
<BR>&gt; &gt; <BR>&gt; &gt; Jeff <BR>&gt; &gt; Check Point =
Software<BR>&gt;=20
&gt; <BR>&gt; &gt;=20
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D<BR>&gt; &gt; <BR>&gt;=20
&gt; You must be using Outlook Express or some other type of newsgroup =
reader=20
to<BR>&gt; &gt; see and download the file attachment(s).&nbsp; If you =
are not=20
using a reader, follow<BR>&gt; &gt; the link below to setup Outlook=20
Express.&nbsp; Click on "Open with newsreader"<BR>&gt; &gt; under the =
MS=20
Retail Management System on the right.<BR>&gt; &gt; <BR>&gt; &gt; <A=20
href=3D"http://tinyurl.com/75bgz">http://tinyurl.com/75bgz</A><BR>&gt; =
&gt;=20
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D<BR>&gt; &gt; <BR>&gt;=20
&gt;&nbsp;&nbsp; "GregDxb" &lt;<A=20
=
rosoft.com</A>&gt;=20
wrote in message <A=20
=
1D3D2-CE0F-4833-A39B-08110D7112CF@microsoft.com</A>...<BR>&gt;=20
&gt;&nbsp;&nbsp; hi,<BR>&gt; &gt; <BR>&gt; &gt;&nbsp;&nbsp; normal=20
procedure..before running any update or delete query, back up your =
<BR>&gt;=20
&gt;&nbsp;&nbsp; data..<BR>&gt; &gt; <BR>&gt; &gt;&nbsp;&nbsp; this is =
the=20
query to delete inactive items<BR>&gt; &gt; <BR>&gt; &gt;&nbsp;&nbsp; =
* I=20
assume that you have updated/set your item into inactive<BR>&gt;=20
&gt;&nbsp;&nbsp; ---------------------------------------------<BR>&gt; =

&gt;&nbsp;&nbsp; delete from item where inactive=3D1<BR>&gt; =
&gt;&nbsp;&nbsp;=20
---------------------------------------------<BR>&gt; &gt;&nbsp;&nbsp; =
or if=20
you want to delete 2000 year old data you can use this<BR>&gt;=20
&gt;&nbsp;&nbsp; ---------------------------------------------<BR>&gt; =

&gt;&nbsp;&nbsp; delete from item where (item.lastupdated &lt;=3D=20
CONVERT(DATETIME, '2001-01-01 <BR>&gt; &gt;&nbsp;&nbsp; 00:00:00',=20
102))<BR>&gt; &gt;&nbsp;&nbsp;=20
--------------------------------------------<BR>&gt; &gt; <BR>&gt;=20
&gt;&nbsp;&nbsp; Run this query after backup is made =
successfully.<BR>&gt;=20
&gt; <BR>&gt; &gt;&nbsp;&nbsp; Good Luck<BR>&gt; &gt; <BR>&gt;=20
&gt;&nbsp;&nbsp; "geokar" wrote:<BR>&gt; &gt; <BR>&gt; =
&gt;&nbsp;&nbsp; &gt;=20
Great,<BR>&gt; &gt;&nbsp;&nbsp; &gt; Now how about deleting inactive=20
items?<BR>&gt; &gt;&nbsp;&nbsp; &gt; <BR>&gt; &gt;&nbsp;&nbsp; &gt; =
"jocelyn"=20
wrote:<BR>&gt; &gt;&nbsp;&nbsp; &gt; <BR>&gt; &gt;&nbsp;&nbsp; &gt; =
&gt; OK,=20
here is your delete qty query from SO Admin:<BR>&gt; &gt;&nbsp;&nbsp; =
&gt;=20
&gt; <BR>&gt; &gt;&nbsp;&nbsp; &gt; &gt; *Backup first*<BR>&gt;=20
&gt;&nbsp;&nbsp; &gt; &gt; <BR>&gt; &gt;&nbsp;&nbsp; &gt; &gt; UPDATE =
Item SET=20
Quantity =3D 0<BR>&gt; &gt;&nbsp;&nbsp; &gt; &gt; <BR>&gt; =
&gt;&nbsp;&nbsp; &gt;=20
&gt; I would also back report this one in HQ Mgr.<BR>&gt; =
&gt;&nbsp;&nbsp;=20
&gt; &gt; <BR>&gt; &gt;&nbsp;&nbsp; &gt; &gt; <BR>&gt; =
&gt;&nbsp;&nbsp; &gt;=20
&gt; <BR>&gt; &gt;&nbsp;&nbsp; &gt; &gt; <BR>&gt; &gt;&nbsp;&nbsp; =
&gt; &gt;=20
<BR>&gt; &gt;&nbsp;&nbsp; &gt; &gt; "geokar" wrote:<BR>&gt; =
&gt;&nbsp;&nbsp;=20
&gt; &gt; <BR>&gt; &gt;&nbsp;&nbsp; &gt; &gt; &gt; Hi,<BR>&gt;=20
&gt;&nbsp;&nbsp; &gt; &gt; &gt; <BR>&gt; &gt;&nbsp;&nbsp; &gt; &gt; =
&gt; Can=20
someone please give me a SQL Query make all On Hand quantities zero =
and=20
<BR>&gt; &gt;&nbsp;&nbsp; &gt; &gt; &gt; to delete all Inactive =
items?&nbsp; I=20
am opening a new store and have copied my <BR>&gt; &gt;&nbsp;&nbsp; =
&gt; &gt;=20
&gt; database to the new location, but I don't think it's necessary to =
keep 3=20
year <BR>&gt; &gt;&nbsp;&nbsp; &gt; &gt; &gt; old items on=20
file</BLOCKQUOTE></BODY></HTML>

------=
Posted by GregDxb on November 9, 2006, 12:24 am
Please log in for more thread options
Hi Geokar,

WOw! your post knockdown every other post in this newgroup because of the
Brightest idea that Jeff ??? gave... but seriously...both ideas will give you
the same result but there are some adverse effect that JEFF wants to strongly
point out which I agree...

Now, having an orphaned records would not hamper your day to day operations
but rather if the item we have deleted have track of movement before..meaning
if you want to get a historical data then problem will come.

So, if this is a stand alone and a shop data...I don't think it will cause
you some trouble...

And for you Jeff, this a free world of interaction. If you want to prove
your point do it in a subtle manner.Not to shout !!! ( I don't know if your
the same Jeff that make a nasty comment to Roxanne , way back but I think it
is not cool).

Good Day

Note* you will not get my VOTE for MVP ( for now !) chiao :)

"Jeff @ Check Point Software" wrote:

> Geokar, GregDXB, Jocelyn, Database, and whoever else has the stupid idea to do
this,
>
> Yeah, that would delete some more of the orphaned records, now how about the
orphans here in these tables;
>
> ItemClassComponent
> InventoryOffline
> InventoryTransferLog
> Kit
> LimitEntry
> PurchaseOrderEntry
> Serial
> TransactionHoldEntry
>
> and there maybe even more cuz I didn't look very hard. ;-)
>
>
> ************************************************
>
> AGAIN, MY POINT IS THAT YOU SHOULDN'T BE DELETING ITEMS THIS WAY. DO IT
THROUGH THE RMS PROGRAM!!!!!!
>
> *************************************************
>
> --
>
> Jeff
> Check Point Software
>
> =====================================================
>
> You must be using Outlook Express or some other type of newsgroup reader to
> see and download the file attachment(s). If you are not using a reader, follow
> the link below to setup Outlook Express. Click on "Open with newsreader"
> under the MS Retail Management System on the right.
>
> http://tinyurl.com/75bgz
> =====================================================
>
> You're missing a table. You need to clear the entry for the inactive item
> from the supplierlist table as well. Otherwise you will have orphaned
> records in the supplierlist table.
>
> Backup your database first!
>
> delete from alias where itemid in (select id from item where inactive=1)
> delete from supplierlist where itemid in (select id from item where
> inactive=1)
> delete from item where inactive=1
>
> If you are in an HQ environment you will also need to delete the records out
> of the itemdynamic table as well as the 3 tables above. The ItemDynamic
> table is not present in SO databases.
> So for HQ databases:
> Backup Database!
>
> delete from alias where itemid in (select id from item where inactive=1)
> delete from supplierlist where itemid in (select id from item where
> inactive=1)
> delete from itemdynamic where itemid in (select id from item where
inactive=1)
> delete from item where inactive=1
>
>
>
>
> "GregDxb" wrote:
>
> > Good Point jeff,
> >
> > I forgot the alias table :)
> > ---delete first the alias---
> > delete from alias where itemid in (select id from item where inactive=1)
> > ---then delete the item---
> > delete from item where inactive=1
> >
> > this is just a solution of what you want.. This is just a practical
solution
> > to delete n # of records rather than going to your records n times depends
on
> > how many inactive you want to delete.
> >
> >
> > "Jeff @ Check Point Software" wrote:
> >
> > > Geokar,
> > >
> > > Again, this routine will leave orphaned records. This will only delete
the entries in the Item database, it will not delete any Supplier's numbers or
Alias' for starters.

> > >
> > > You're better off, if you _really_ want to delete them, to do it though
the program!
> > >
> > > --
> > >
> > > Jeff
> > > Check Point Software
> > >
> > > =====================================================
> > >
> > > You must be using Outlook Express or some other type of newsgroup reader
to
> > > see and download the file attachment(s). If you are not using a reader,
follow
> > > the link below to setup Outlook Express. Click on "Open with newsreader"
> > > under the MS Retail Management System on the right.
> > >
> > > http://tinyurl.com/75bgz
> > > =====================================================
> > >
> > > hi,
> > >
> > > normal procedure..before running any update or delete query, back up
your
> > > data..
> > >
> > > this is the query to delete inactive items
> > >
> > > * I assume that you have updated/set your item into inactive
> > > ---------------------------------------------
> > > delete from item where inactive=1
> > > ---------------------------------------------
> > > or if you want to delete 2000 year old data you can use this
> > > ---------------------------------------------
> > > delete from item where (item.lastupdated <= CONVERT(DATETIME,
'2001-01-01
> > > 00:00:00', 102))
> > > --------------------------------------------
> > >
> > > Run this query after backup is made successfully.
> > >
> > > Good Luck
> > >
> > > "geokar" wrote:
> > >
> > > > Great,
> > > > Now how about deleting inactive items?
> > > >
> > > > "jocelyn" wrote:
> > > >
> > > > > OK, here is your delete qty query from SO Admin:
> > > > >
> > > > > *Backup first*
> > > > >
> > > > > UPDATE Item SET Quantity = 0
> > > > >
> > > > > I would also back report this one in HQ Mgr.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > "geokar" wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Can someone please give me a SQL Query make all On Hand
quantities zero and
> > > > > > to delete all Inactive items? I am opening a new store and have
copied my
> > > > > > database to the new location, but I don't think it's necessary
to keep 3 year
> > > > > > old items on file

Similar ThreadsPosted
Delete Items and Make Items Inactive January 27, 2009, 10:57 am
Inactive Items May 16, 2007, 6:47 pm
Inactive Items December 17, 2009, 2:57 pm
Making Items Inactive October 18, 2006, 2:27 pm
Unused and old items to Inactive January 13, 2007, 2:48 pm
RE: How to make items with QTY=0 Inactive ? March 27, 2007, 7:55 pm
RE: How to make items with QTY=0 Inactive ? March 27, 2007, 8:05 pm
How to make items with QTY=0 Inactive ? March 27, 2007, 10:07 pm
How Much Space DO Inactive Items take up? May 30, 2007, 11:50 am
Making items inactive October 3, 2007, 11:44 am

Contact Us | Privacy Policy
This site is not affiliated with Intuit - makers of Quickbooks and Quicken software
This site is not affiliated with Sage Software - makers of Peachtree accounting software
XML SitemapXML Sitemap