[windows2000] Re: MS SQL QUESTION: PLEASE HELP!

  • From: "Rob Combis" <rcombis@xxxxxxxxxxxx>
  • To: <windows2000@xxxxxxxxxxxxx>
  • Date: Fri, 22 Nov 2002 11:32:49 -0500

Matt-
There is a pretty good SQLserver list at sql_server@xxxxxxxxxxxxxxxx  =
There are some pretty knowledgeable people on that list, I think they =
will solve this for you.  Sorry I could not have been more help.

-----Original Message-----
From: Matthew Studer [mailto:matthew_studer@xxxxxxxxxxx]
Sent: Friday, November 22, 2002 11:24 AM
To: windows2000@xxxxxxxxxxxxx
Subject: [windows2000] MS SQL QUESTION: PLEASE HELP!


 I am trying to make these 2 statements (see below) into1 statement so =
it
will find AND delete duplicate entries.  I don't want to do each =
manually.=20
It takes me too long to enter each value in that my select statement =
finds
before deleteing it.   But I can't just substitute DELETE for SELECT or =
it
says:   Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '*'.   Any ideas????
************************************* =
************************************* =20
MS SQL SERVER VER 8.00   --UPS
-- Step 1;This script will detect if any duplicates are in the
NCT_UPS_Import_Data_Totals Table=20
Select PackageReference2, count(PackageReference2)as 'TRANS'
into ##TEMP1
from NCT_UPS_Import_Data_Totals=20
group by PackageReference2=20
Select * from NCT_UPS_Import_Data_Totals A join ##TEMP1 B on
A.PackageReference2 =3D B.PackageReference2 where B.TRANS <>'1'     -- =
Step
2;Use this script to delete the desired duplicate by modifing the fields
PackageReference2 and CODFrt Delete from NCT_UPS_Import_Data_Totals =
where
PackageReference2 =3D 'MY INVOCE # GOES HERE' and CODFrt =3D 'MY NUMERIC =
VALUE
FOR MY COD CHARGES GOES HERE'


=20

-------------------------------------------------------------------------=
---
STOP MORE SPAM with the new MSN 8[1] and get 2 months FREE*=20

--- Links ---
   1 http://g.msn.com/8HMDEN/2015

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
To Unsubscribe, set digest or vacation
mode or view archives use the below link.

http://thethin.net/win2000list.cfm

==================================
To Unsubscribe, set digest or vacation
mode or view archives use the below link.

http://thethin.net/win2000list.cfm

Other related posts: