Viewing 15 posts - 1,021 through 1,035 (of 1,419 total)
No looping necessary. Check out this script:
https://www.sqlservercentral.com/scripts/a-daterange-table-valued-function
It generates any range of days (or seconds or years...)
declare
@start_day_num int=5, /*...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 19, 2020 at 6:31 pm
drop table if exists dbo.test_j;
go
create table dbo.test_j(
[data] nvarchar(max));
go
insert dbo.test_j([data]) values('{"data": [{"id": "123", "title": "Webinar1", "nickname": "", "href":...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 19, 2020 at 12:02 pm
Sorry my answer was no good. I tried to edit it and now it's been marked as spam for some reason. If you posted a sample txt file it would...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 19, 2020 at 12:02 pm
Again, why is it "suboptimal"? As long as the values are always ascending, what difference does it make to SQL, or to us, if there are gaps in the...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 18, 2020 at 3:18 pm
It really sounds like you should be using a SEQUENCE rather than an identity, that is, that this INSERT is just to get an identity value, which...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 16, 2020 at 8:50 am
It really sounds like you should be using a SEQUENCE rather than an identity, that is, that this INSERT is just to get an identity value, which is no...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 15, 2020 at 8:10 pm
drop table if exists dbo.test_j;
go
create table dbo.test_j(
j nvarchar(max));
go
insert dbo.test_j(j) values('[{"id":"36653","invoicenumber":"8224131","billinginvoiceid":"948439"},{"id":"36651","invoicenumber":"8224133","billinginvoiceid":"948437"},{"id":"36652","invoicenumber":"8224134","billinginvoiceid":"948438"},{"id":"36654","invoicenumber":"8224155","billinginvoiceid":"948440"},{"id":"36655","invoicenumber":"8224161","billinginvoiceid":"948442"}]');
select j_open.*
from
dbo.test_j j
cross...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 15, 2020 at 12:28 pm
Jeff, quit torturing the poor guy and just give him the link
Nice. Is there a unicode version?
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 14, 2020 at 8:56 pm
Interesting. Does it correctly handle names like MacDonald, McDonald, van Halen, O'Leary, and things like "This is a Book"?
I think it's pretty basic. iirc "select initcap('This is a Book')...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 14, 2020 at 8:45 pm
It's title caps. In Oracle since 8i
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 14, 2020 at 7:24 pm
Incorporating Jeff's improvements and refactoring again this is what I came up. Since this is the 2019 thread I created an INITCAPS scalar function which should execute inline, although it's...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 14, 2020 at 4:34 pm
Jeff, you have 2 solutions here, which is the preferred? I like the 2nd one. And why is there no INITCAP() function in SQL Server? That's waaaay overdue.
Regarding labeling query...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 14, 2020 at 12:52 pm
This is really good. The syntax is a little inconsistent and the use of sub-queries instead of cte's is not really considered current. Also, no need for the floor function...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 13, 2020 at 8:47 pm
Hi pietlinden, I saw this yesterday and was going to reply but then got distracted. Is the ToxBad table in the structure it was received or did you normalize what...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 13, 2020 at 12:22 pm
I I've been taking SQL for many decades, this literally was the best analogy I can come up with. Please give me a better one so I can use...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
May 12, 2020 at 8:33 pm
Viewing 15 posts - 1,021 through 1,035 (of 1,419 total)