Viewing 15 posts - 7,006 through 7,020 (of 7,608 total)
And don't forget about computed columns. You can make this a computed column, so you don't have to have the generating code in a trigger. Since it's a...
December 15, 2012 at 5:05 pm
I disagree completely.
I've repeatedly gotten huge performance gains sometimes by indexing temp tables properly. They are tables like any other table, after all. For large tables, I've seen...
December 15, 2012 at 5:01 pm
You could also use an INNER JOIN to a hard-coded table:
select
case parents.whichParent when 'father' then s.father when mother then s.mother else s.parent_guardian end,
...
December 15, 2012 at 4:53 pm
CELKO (12/14/2012)
[ Yiikes, that's incredibly convoluted. What a royal pita to try to understand, much less change or debug later!!
But it is fast and portable 😀
On a more serious...
December 14, 2012 at 5:43 pm
CELKO (12/14/2012)
.. Total failure.. Besides which, I believe my earlier post was the same idea, except coded correctly 🙂 .
Yeah, it was awful! :crazy:
What I wanted to do was...
December 14, 2012 at 5:11 pm
Sorry, I didn't have test data so I couldn't pre-test it myself.
If you'll post some data as INSERT statements, I'll be happy to correct the query.
December 14, 2012 at 1:18 pm
GSquared (12/14/2012)
CELKO (12/13/2012)
My table structure
Please read just one little book on SQL and RDBMS. Please, just one little book! This is not a table; it has no key;...
December 14, 2012 at 8:22 am
CELKO (12/13/2012)
My table structure
Please read just one little book on SQL and RDBMS. Please, just one little book! This is not a table; it has no key; it...
December 14, 2012 at 8:01 am
SELECT object_name, database_name, DATEPART(Week, event_time) AS EventWeek, SUM(sequence_number) AS [#TimesAccessed],
DATEADD(HOUR, DATEDIFF(HOUR, 0, event_time), 0) AS [EventHour]
INTO #EventHour
FROM ...
December 13, 2012 at 5:15 pm
ScottPletcher (12/12/2012)
CELKO (12/11/2012)
December 13, 2012 at 4:54 pm
It's normal IF the indexing on the data was not optimal, so that you were scanning old data before that has now been removed.
Note that when you DELETE a large...
December 13, 2012 at 2:25 pm
Only 'YYYYMMDD', rather than 'YYYY-MM-DD', is 100% safe:
INSERT INTO T1 (createdate)
VALUES ('20120309 12:34:45:567')
December 13, 2012 at 2:11 pm
I'd suggesting not using that particular new "enhancement" at all while you still have ANY older instances / compatability settings.
It doesn't save you that much anyway. Not worth the...
December 13, 2012 at 2:09 pm
Whenever possible, you should use:
EXEC sp_executesql @sql [rather than EXEC(@sql)]
because it is far less susceptible to SQL injection, although not foolproof depending on what...
December 13, 2012 at 2:01 pm
Here's another possible approach, in case you ever have to do (many) more columns 🙂 :
DELETE FROM dbo.trefClientShares
WHERE
CASE WHEN intLMid IS NULL THEN 1 ELSE 0...
December 13, 2012 at 1:51 pm
Viewing 15 posts - 7,006 through 7,020 (of 7,608 total)