Viewing 15 posts - 6,991 through 7,005 (of 7,597 total)
Since you have to ALTER columns only one at a time (why, MS, why??), I'd create a new table and INSERT every row into it, converting every column at one...
December 17, 2012 at 4:00 pm
sp_MSforeachdb is convenient, but it has huge overhead and is probably overkill for what you need.
You can use sp_executesql to return a value from dynamic SQL, albeit that it's not...
December 17, 2012 at 3:50 pm
TheSQLGuru (12/16/2012)
December 17, 2012 at 8:34 am
If I understand correctly, maybe something like below.
[Btw, as a general performance guideline, make sure the datatype of the time in the table exactly matches your list of times. ...
December 15, 2012 at 5:32 pm
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
Viewing 15 posts - 6,991 through 7,005 (of 7,597 total)