Robert
rl_stewart at highstream.net
Mon Jul 9 14:03:08 CDT 2007
What she is saying is change one record to a valuse of D. Delete all the C's. change the one record that is D back to C At 12:00 PM 7/9/2007, you wrote: >Date: Sun, 8 Jul 2007 21:32:39 -0400 >From: "Susan Harkins" <ssharkins at setel.com> >Subject: Re: [dba-SQLServer] Delete all records of a particular type > from atable except for one copy. >To: <dba-sqlserver at databaseadvisors.com> >Message-ID: <001501c7c1c9$0e6f7040$93b82ad1 at SusanOne> >Content-Type: text/plain; charset="us-ascii" > >Why would you need an AutoNumber field? > >Find the records that match MyCode -- grab the top record and change its >MyCode value -- run the first query as a delete, reset the top record's >MyCode value. > >Or, count the records and grab the count -1 in your delete -- can you do >that? > >Susan H. > >It may sound funny but I do not care which record is the record left. I was >hoping that another step of adding an 'autoNumber' field was not necessary >but maybe it is...