Viewing 15 posts - 211 through 225 (of 465 total)
Alvin Ramard (6/3/2015)
One option would be to send the results to file. I know I'd like a better option, but it's better than nothing.
I'd like to keep it in...
June 3, 2015 at 3:57 pm
ZZartin (6/3/2015)
Unless real time updates to the view are needed could you just run a scheduled job every however often to populate your temp table instead of using triggers?
Yes, I...
June 3, 2015 at 12:28 pm
Not a bad idea, but that someone would most likely be me, so I think it's better to build triggers that prevent the situation from occurring in the first...
May 26, 2015 at 12:19 am
Now that I think about it some more, I'm not even sure that it's possible to enforce an 'exactly one' condition, even with code. It would never be possible for...
May 25, 2015 at 8:36 am
spaghettidba (5/25/2015)
You could also use indexed views. I have a blog post on the subject here[/url].
Thanks for the tip. I'm looking at your blog, but it's a bit technical and...
May 25, 2015 at 7:48 am
GilaMonster (5/25/2015)
CREATE UNIQUE INDEX idx_TableOfClovekNames_ClovekAutoIDON TableOfClovekNames (ClovekAutoID)
WHERE JeHlavni = 1
The unique requirement on that only applies to rows where JeHlavni is 1, and it forces that there may not be...
May 25, 2015 at 7:46 am
GilaMonster (5/25/2015)
You want to ensure that there is only ever one row with JeHlavni = 1 for each...
May 25, 2015 at 7:10 am
dwain.c (5/19/2015)
May 20, 2015 at 12:20 am
That was a question, not a conclusion. Notice the question mark at the end of the first sentence. The second was simply a restatement of what I'm trying to do,...
May 19, 2015 at 2:43 pm
dwain.c (5/18/2015)
SELECT *
INTO #Test
FROM (Values
(1, 'A'),
(1, 'B'),
(1, 'C'),
(1, 'D'),
(1, 'E'),
(2, 'A'),
(2, 'C'),
(2, 'D'),
(2, 'E'),
(3, 'A'),
(3, 'B'),
(3, 'C'),
(3, 'F'),
(4, 'A'),
(4, 'B'),
(4, 'D'),
(4, 'F'),
(4, 'G'))x(id, value);
SELECT id
...
May 19, 2015 at 12:05 am
Got it - fat-fingered an edit when I copied out some parts of the query for my original post. Works great - many thanks, Luis. Complex execution plan, that's going...
May 18, 2015 at 12:47 pm
Well, here's the actual query, if you want to take a stab at it, but I haven't assembled all the necessary TSQL to give you the entire data environment on...
May 18, 2015 at 11:57 am
That looks promising, but I'm getting an error:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when...
May 18, 2015 at 11:46 am
Thank you everyone for the input and suggestions. I've decided to go with a trigger, largely because everything is in one place. The check constraint option has the disadvantage of...
December 15, 2014 at 6:58 am
Emil Bialobrzeski (12/11/2014)
ALTER TABLE Test ADD CONSTRAINT CK_Test CHECK (dbo.CKTest(ID, Letter, Number, OptionalLetter) = 0)
EDIT:
Use the code...
December 11, 2014 at 8:18 am
Viewing 15 posts - 211 through 225 (of 465 total)