Viewing 15 posts - 961 through 975 (of 1,419 total)
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
What Frederico wrote at the ende: "note that if this query is called multiple times for location then it should be changed so that all locations are supplied (alongside their...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 16, 2020 at 1:46 pm
Phil's solution works well. It's more flexible in that there could be more than 1 character to prefix the []'s
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 15, 2020 at 9:14 pm
Ok here's a tvf which maybe makes it more maintainable and readable. Fwiw I don't follow Brian's approach and keeping data manipulation logic in the database seems OK imo. To...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 15, 2020 at 8:36 pm
drop table if exists dbo.test_TID;
go
create table dbo.test_TID(
TIDPrefix varchar(20) not null);
insert dbo.test_TID(TIDPrefix) values
('A[123xyz]'),
('x[UY345]'),
('XP');
drop function if exists dbo.fnTally;
go
CREATE FUNCTION [dbo].[fnTally]
/**********************************************************************************************************************
...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 15, 2020 at 7:57 pm
Cl 110 is equivalent to SQL Server 2012 iirc
This link has the implementation which (according to Jeff's notes in the function) should work for SQL Server 2008 and above
https://www.sqlservercentral.com/scripts/create-a-tally-function-fntally
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
July 15, 2020 at 6:36 pm
Viewing 15 posts - 961 through 975 (of 1,419 total)