Viewing 15 posts - 436 through 450 (of 1,228 total)
CELKO (10/14/2012)
I am not surprised that loading the week_in_year_date is expensive; it is a lot of temporal and string function calls. Those are expensive in T-SQL.
The function is thirty...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 14, 2012 at 3:02 pm
CELKO (10/14/2012)
It's trivial to set up an inline table-valued function which models such a calendar table. The code is simple to modify, e.g. the startdate and enddate parameters could...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 14, 2012 at 11:52 am
L' Eomot Inversé (10/14/2012)
ChrisM@home (10/14/2012)
Jeff Moden (10/12/2012)
Cadavre (10/12/2012)
If you insist on doing it in the database layer, it can be achieved like this:
Check again. OP's desired output doesn't actually...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 14, 2012 at 9:34 am
Vedran Kesegic (10/12/2012)
Check for STR, CONVERT, and REPLACE functions to additionally format the numbers as string.
I can't work out how any of these three functions can help. Please show us.
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 14, 2012 at 7:05 am
Vedran Kesegic (10/12/2012)
Check for STR, CONVERT, and REPLACE functions to additionally format the numbers as string.
I can't work out how any of these three functions can help. Please show us.
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 14, 2012 at 7:05 am
Jeff Moden (10/12/2012)
Cadavre (10/12/2012)
If you insist on doing it in the database layer, it can be achieved like this:
Check again. OP's desired output doesn't actually have a comma as...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 14, 2012 at 7:04 am
CELKO (10/13/2012)
I also like your idea of having a report_periods_table to keep the business on the same page as to these reporting periods. I must confess though that I...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 14, 2012 at 4:53 am
Don. (10/13/2012)
Unfortunately neither of those scripts worked as there are multiple identical accountno and lastdate fields. Ideally Id need to filter on the History tables Recid field.
I've dummied up...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 14, 2012 at 2:53 am
L' Eomot Inversé (10/13/2012)
Eskandari (10/10/2012)
CREATE TABLE Test ( field_one nvarchar(10) );
DECLARE @i int;
WHILE @i<= 1000
...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 14, 2012 at 2:27 am
Don. (10/12/2012)
SELECT c.*, x.*
FROM Contact c
OUTER APPLY (
SELECT TOP 1 h.*
FROM History h
WHERE h.Accountno...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 13, 2012 at 2:30 pm
thomasrichardson2000 (10/11/2012)
INSERT INTO #Temp
SELECT '5000023', '83', 'EDMN', 'FIAT', 'GRANDE...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 12, 2012 at 12:54 am
thomasrichardson2000 (10/11/2012)
Yes when I order them by Vehicle.modelId...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 11, 2012 at 10:24 am
Can you post an example of one of the TVF's?
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 11, 2012 at 10:22 am
What do you see if you order the results by Vehicle.modelId? Do you get multiple rows per model? That's what I'm looking for.
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 11, 2012 at 10:04 am
thomasrichardson2000 (10/11/2012)
500000384EDMNFIATGRANDE PUNTO 1.28V DYNAMIC 5DROF 2012-07-31 00:00:00.0001
Sorry the query ran fine, it just returned the exact same result set as the...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
October 11, 2012 at 9:17 am
Viewing 15 posts - 436 through 450 (of 1,228 total)