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 2005 Forums
 SQL Server Administration (2005)
 No Unique Key / Avoid Dups

Author  Topic 

mlevier
Starting Member

33 Posts

Posted - 2007-10-16 : 14:39:45

I have a table that I cannot create a unique key for because there is nothing unique and I can concatenate anything together to create one. I am looking for a way to import the data daily and have it only import what is not already in the table like a unique index would normally do. I don't want a sequencial number because that would do me any good. I need the record only in there once but I want to get all of the records in the new table. I have a date field with this if that at all helps. I am wondering if I could create a couple of feeder table to make this work but i am stuck. Any ideas on what to do? Thanks!!!

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-10-16 : 14:55:28
Unless you define what makes your data unique, you cannot avoid duplicates because there is logically no way to do this! I sure hope that makes sense ... And if you can define what makes your data unique, then you can add a unique constraint and/or primary key to your table.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

mlevier
Starting Member

33 Posts

Posted - 2007-10-16 : 14:56:41
I know. I am just hoping that there is a hot shot way around this that is very, very, new to the world.
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-10-16 : 14:58:29
No one can write a single line of code to "magically" do things that are not logically possible. Sorry.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

mlevier
Starting Member

33 Posts

Posted - 2007-10-16 : 15:00:24
Is there a way to look at other records and if it is all there put it into another table and if it isn't there populate the first table?
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-10-16 : 15:01:58
Check out books online for EXISTS.

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-10-16 : 15:01:59
Yes, but you need to define what it means "if it isn't there". How is that determined? Magically? if you can explain to us what you have, and what you need, or what columns to check and so on, we can help, otherwise how can we? you have provided absolutely no details at all to help us help you.



- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
   

- Advertisement -