Viewing 15 posts - 57,451 through 57,465 (of 59,059 total)
Alex,
Nice article especially for the proverbial "newbie". I do agree that the examples were a bit overdone but how are ya going to learn if you don't try?
October 9, 2006 at 7:49 pm
I've found that that is NOT true... not with INT ID's anyway... In my testing of the various solutions posted against this article, I get INDEX SCAN's, not table scans using WHERE (CustID...
October 9, 2006 at 7:39 pm
Sorry... it's a "Moden-ism" pronounced "ree-bar" and stands for "Row By Agonizing Row"
Why "ree-bar"? Because it's like the metal stakes stuck in...
October 9, 2006 at 4:18 pm
p.s. You would be amazed at just how useful that Tally table is gonna be... and, a lot of the time, it will greatly enhance the performance of your code......
October 8, 2006 at 5:30 pm
Aye... and thank you for the feedback, Perry.
October 8, 2006 at 5:25 pm
p.s. The above was from your original query... it does not include the change due to the "blond-attack" ![]()
October 8, 2006 at 5:23 pm
Ugh! Correlated Sub-Queries = Instant RBAR. Not good... real performance killer. Should be a derived table. WHERE IN... not good... should be an equi-join (inner join).
Haven't tested it but I'm...
October 8, 2006 at 5:21 pm
I don't use debuggers in SQL Server... just the ol' Mil Spec Mark I Mod I Eyeball. Probably not what you wanted to hear, though...
What are you trying to debug...
October 8, 2006 at 4:57 pm
I loved the examples... nice and simple. Great job, DC.
October 8, 2006 at 11:59 am
Yep... this is about 3 times faster (I tested both)...
CREATE FUNCTION dbo.GetDOWCount
(
@StartDate DATETIME,
@EndDate DATETIME,
@DOW VARCHAR(9) --Monday, Tuesday, Wednesday, etc
)
RETURNS INT
AS
BEGIN
RETURN (SELECT...
October 7, 2006 at 8:11 pm
Actually, a function would slow stuff down here... you want the full table to be split... why do it a line at a time? Try this, instead...
--==================================================================================================
-- This...
October 7, 2006 at 6:41 pm
For what? Inserts, Updates, Deletes, or Selects?
October 7, 2006 at 6:16 pm
Try something like this, instead...
SELECT
locationId, locationId AS original_locationId, locationCode, description, divisionCode, companyId
FROM locations
ORDER BY companyId,
CASE
WHEN locationCode NOT LIKE '%[^0-9]%' THEN STR(locationcode,10)
ELSE locationcode
END,
locationCode
October 7, 2006 at 6:08 pm
ISNUMERIC does NOT mean IS ALL DIGITS... you're making a BIG mistake using it for that. If you don't think so, try this...
SELECT NULL AS [ASCII#],'12D45' AS [Character(s)],ISNUMERIC('12D45')...
October 7, 2006 at 5:57 pm
Viewing 15 posts - 57,451 through 57,465 (of 59,059 total)