Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Distinct not working

Author  Topic 

Teroman
Posting Yak Master

115 Posts

Posted - 2001-10-22 : 05:18:32
Has anyone else ever had a problem with this.I've been getting primary key violations even though my insert had a distinct and a not exists at the end to prevent duplicates.

It turned out the distinct wasnt working, in the middle of the data I get


504817 37941 -1
504836 37941 -1
504838 37941 -1
504817 37941 -1

as you can see the first and last rows are the same!!

i put the select into a derived table, and distincted it again, same problem.
Tried sorting it to "help" sql server out, STILL not working.

anyone got any smart ideas(not oracle ;-) )

thanks in advance

col

   

- Advertisement -