April 15, 2010 at 12:44 pm
I have a situaton where in i need to define unique combination of some of the columns I tried defined it using composite primary key. But I have more than 70 columns and this is exceeding 900 bytes. Anybody has any solution. Please let me know.
April 15, 2010 at 12:51 pm
anbillava (4/15/2010)
I have a situaton where in i need to define unique combination of some of the columns I tried defined it using composite primary key. But I have more than 70 columns and this is exceeding 900 bytes. Anybody has any solution. Please let me know.
Why do you need a composite key made up of more than 70 columns? Something doesn't sound right here.
April 15, 2010 at 12:53 pm
I have situation where in if user enters same data then i need throw him a error message depending up on the primary key violation. Each row in the table should be unique against the other. Any other solution is appreciated.
Thanks
April 15, 2010 at 12:58 pm
You could assign a unique key to a checksum of all of the columns.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 15, 2010 at 12:59 pm
Thanks for the reply.
CAn you please tell me how to do that ?
April 15, 2010 at 1:01 pm
Try this article.
http://www.mssqltips.com/tip.asp?tip=1023
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
April 15, 2010 at 1:06 pm
So what you are saying is that in this particular table, there is no candidate key that could serve as a primary key?
April 15, 2010 at 1:07 pm
Seems to me that this article may also help, http://www.sqlservercentral.com/articles/Data+Warehouse/69679/.
April 15, 2010 at 1:08 pm
Is that link tells me about defining unique key for checksum of mulitple columns.
I did not understand how that works ?
Do i need to check table for the duplicate row using checksum function or blind entry of new data which is duplicate will throw a vilolation ?
April 15, 2010 at 1:12 pm
No. There is no candidate key which can replace this.
April 15, 2010 at 1:14 pm
Actually, anything we tell you is simply a shot in the dark. We have no idea what you are trying to do, or what type of data is being stored in this (currently) nebulus table in which the primary key appears to be every column in the table.
Where and how is the data being inserted into the table? Is the data load from a file or entry from an application?
April 15, 2010 at 1:28 pm
CAn anybody help me in defining checksum column ?
MAny Thanks
April 15, 2010 at 1:50 pm
Hi all,
I am able to define checksum column and do the job .
Thanks to all.
Anand
April 15, 2010 at 1:58 pm
You're welcome. Hope it works out for you.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
Viewing 15 posts - 1 through 15 (of 46 total)
You must be logged in to reply to this topic. Login to reply