|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, January 31, 2013 8:01 AM
Points: 1,232,
Visits: 1,046
|
|
I am giong to get my point I lost back!
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, January 31, 2013 8:01 AM
Points: 1,232,
Visits: 1,046
|
|
BowieRules! (12/2/2010)
I am sorry for confusing you with insert option, I only included it here because I found it on another blog as a solution to the problem, which I agree is not really a solution, but still a valid workaround, especially if it is put in a good InsertUpdate stored procedure.
This is not an administrative workaround and will not enforce the contraint from a DBA perspective.
It would not pass an Audit either. The other solutions listed would.
I am giong to get my point I lost back!
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, January 31, 2013 8:01 AM
Points: 1,232,
Visits: 1,046
|
|
I am giong to get my point I lost back!
Am I being greedy?
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Friday, June 14, 2013 7:34 AM
Points: 2,865,
Visits: 2,472
|
|
SanDroid, I was wondering when you were going to show up
(I need to get mine back as well )
Steve Jimmo Sr DBA “If we ever forget that we are One Nation Under God, then we will be a Nation gone under." - Ronald Reagan
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Friday, March 15, 2013 2:43 PM
Points: 3,924,
Visits: 1,554
|
|
Got it right by fluke, but still trying to figure out how this one would resolve the issue:
Create a calculated column that is based on the column that allows nulls, and then define a UNIQUE constraint on the calculated column.
SQL DBA.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, January 31, 2013 8:01 AM
Points: 1,232,
Visits: 1,046
|
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Thursday, May 30, 2013 5:24 PM
Points: 1,565,
Visits: 835
|
|
The statement "I found it on another blog as a solution to the problem" worries we. Just because someone says something, especially on the internet, doesn't mean it's correct. As many have pointed out previously, enforcing something in the app isn't really enforcing anything at all, because as soon as someone uses a different app there's no enforcement at all.
(I'd also be very amused to watch how that "solution" scaled as the number of rows increased, unless I had to support it that is).
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 4:53 PM
Points: 7,182,
Visits: 7,281
|
|
Well, as has been pointed out already the 5th "correct" option doesn't handle update statements at all and even for inserts it handles only single row inserts.
Nevertheless, it's a good question (despite that flaw in the answer) because it's thought-provoking. And I don't imagine I'm the only one who wasn't previously aware of Hugo's connect item and added a vote as a result of this, so with some luck the question has added a few votes that may help MS realise that this is a serious issue.
It raises an interesting side-issue: how bizarre does a "work-around" have to be before it ceases to count as a real work-around. I guess any answer to that is going to be subjective. For myself, I reckon a filtered index is a good work-around, and a trigger is a passable work-around. But I'll go along with an earlier comment about the computed column solution - why do I want to invent some weird imaginary column to do something that the SQL standard says I can do without it? It works, of course, but I don't like it one bit. Neither do I like the indexed view work-around, although of course that too works; but confusing an index (an access mechanism) with a view (a derived relation) seems to me to be a step too far from the relational model.
Tom Is minic a gheibheann béal oscailte dorn dúnta. Is minig a cheapas beul fosgailte dòrn dùinte.
http://es.linkedin.com/in/tomthomsonsoftware
|
|
|
|
|
SSCoach
         
Group: General Forum Members
Last Login: Today @ 5:03 PM
Points: 18,853,
Visits: 12,438
|
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Wednesday, September 21, 2011 4:03 AM
Points: 713,
Visits: 100
|
|
Hi,
It is always hard to get the right answer for this kind of question. There is more probability that you will miss at least one point.
So I think rather then giving 8 options together in 1 question, it should be distributed to 2 to 3 questions and then it would be better justice.
Regards,
-------------------------------------------------------------------------------- Mayank Parmar Software Engineer Clarion Technologies SEI CMMI Level 3 Company 8th Floor, 803, GNFC info Tower, SG Highway, Ahmedabad - 380 054, Gujarat, India. www.clariontechnologies.co.in Email: mayank.parmar@clariontechnologies.co.in MSN : mayank.parmar@clariontechnologies.co.in Mobile: +91 9727748789 --------------------------------------------------------------------------------
|
|
|
|