Usman,
Just for kicks, try:
select Number, count(*) from TABLE_2
group by Number
having count(*) > 1
If something comes back, it should indicate your problem.
. . . Tom
On 06/17/2003 09:36:50 AM Usman Farhat wrote:
> Hi Everyone,
>
> I have a particular situation in which i got one table with duplicated data , i
> am using this query to import
> data that is not imported previously. While Number in this case is a primary
> key.Durring importation this
> query returns me error of primary key violation. Can someone tell is this not
> the correct query to carry
> out task i am desiring ?
>
> INSERT INTO TABLE_1 SELECT * FROM TABLE_2 WHERE Number NOT
> IN(SELECT Number FROM table_1)
>
> Thanks,
> Usman
-----------------------------------------------------------------
Visit our Internet site at http://www.reuters.com
Get closer to the financial markets with Reuters Messaging - for more
information and to register, visit http://www.reuters.com/messaging
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Reuters Ltd.
MS Sql Server LazyDBA home page