Viewing 15 posts - 961 through 975 (of 1,424 total)
Jason A. Long the "s3 string" characters which appear after the brackets do not appear in any of the OP's example rows. Imo that's a made up requirement which most...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 25, 2020 at 7:03 pm
When I switch the datediff metric to nanoseconds and run the script over and over again the tally and cte are equal at 0 ns up to about 500 rows. ...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 25, 2020 at 2:08 pm
This script prints start/stop timestamps before/after running 2 queries. Query 1 counts rows generated by the tally function. Query 2 uses a recursive CTE. With n=10000, Q1 takes 0 ms. ...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 25, 2020 at 12:20 pm
Afaik the OP didn't state the end dates couldn't be in the future. It seems safer to test against '9999-12-31'. Still WITH SCHEMABINDING so no physical table. Here's using the...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 24, 2020 at 3:30 pm
Ok, if the end date is less than the deceased date, then use the end date, else use the deceased date.
select ds.*, fsm.*
from
#date_split ds
cross...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 23, 2020 at 2:19 pm
It's been refactored into an fnSplitMonth function WITH SCHEMABINDING. Then I did what Sergiy suggested 🙂
/* updated */
drop table if exists #date_split;
go
Create Table #date_split(
ID ...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 23, 2020 at 11:31 am
Aha ok yes afaik the cache is clear-able on local instances. I work mostly on Azure SQL these days and the DBCC statements to clear cache don't apply/work (maybe yet?). ...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 22, 2020 at 4:41 pm
Ok so is the execution cache cleared of the tally function between each execution? Or according to what timeout period or ??
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 22, 2020 at 3:27 pm
... Your solution is much more cpu heavy if the statement is only rarely executed and needs to be compiled every time. I think that the design will be...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 22, 2020 at 1:38 pm
drop table if exists #date_split;
go
Create Table #date_split
(
ID INT,
StartDate DATE,
EndDate ...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 22, 2020 at 12:10 pm
That was the correct clarification 🙂
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 20, 2020 at 4:52 pm
Imo that does not appear to be an infallible method. Would you agree?
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 20, 2020 at 4:26 pm
In 2016+ it could be done like this
drop function if exists dbo.fnCommaOnce;
go
create function dbo.fnCommaOnce(
@comma_str ...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 20, 2020 at 3:33 pm
If tvf's are allowed then I'd borrow some of Phil's code
drop function if exists dbo.fnTIDprefix_Expand;
go
create function dbo.fnTIDprefix_Expand(
@TIDprefix ...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 17, 2020 at 4:24 pm
Nah... it's easier than that. Create a stored procedure that does the work, give the spreadsheet user privs to execute it, and have them execute the stored procedure from...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 16, 2020 at 2:02 pm
Viewing 15 posts - 961 through 975 (of 1,424 total)