Viewing 15 posts - 991 through 1,005 (of 1,390 total)
Nicely done! It looks cleaned up now
May 19, 2020 at 8:14 pm
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, /*...
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":...
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...
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...
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...
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...
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...
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?
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')...
May 14, 2020 at 8:45 pm
It's title caps. In Oracle since 8i
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...
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...
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...
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...
May 13, 2020 at 12:22 pm
Viewing 15 posts - 991 through 1,005 (of 1,390 total)