Viewing 15 posts - 391 through 405 (of 5,111 total)
are you sure ...?
if I understand ...to run the procedure with EXECUTE AS 'sa' I have to give a user a grant to impersonate 'sa'.
Am I granting him the...
October 2, 2020 at 3:31 pm
Hi Thom,
Feel daft asking, but instead of the values you manually inserted here:
FROM (VALUES(CONVERT(datetime,'2020-11-20T00:00:00.000'), 900),
(CONVERT(datetime,'2020-11-21T00:00:00.000'), 1700))V(D,T))
How do i get it to point at my actual table and get the...
September 30, 2020 at 3:49 pm
If you give the USER
(LOGIN
actually here) permission to impersonate the sa
, that is certainly a security risk, yes. Then would be able to then use EXECUTE AS LOGIN...
September 30, 2020 at 3:33 pm
How come JSON_VALUE(v.value, '$.fields.MainValue.newValue') returns a value?
Because that exists in yoru data.... There is no element called "System" not "State", you have one called "System.State" and are trying to...
September 30, 2020 at 3:05 pm
Cross post of Stack Overflow as well, for future readers.
September 30, 2020 at 2:50 pm
I can't keep on giving answers on moving goal posts. I have shown how you would do this, I will leave it to you to implement.
JSON_VALUE(v.value, '$.fields.System.State.newValue')
will not work...
September 30, 2020 at 2:48 pm
Cannot you work your SQL magic using Datetime as Date and Time as smallint?
That's exactly what my solution does treat the data as... D
is defined as a datetime
,...
September 30, 2020 at 2:27 pm
Because System.State
is in value.fields
, you're looking for value."System.ID"
, which doesn't exist. System.State
is also a further JSON value. You can short cut to value.fields
in the OPENJSON
call, which...
September 30, 2020 at 2:16 pm
I would personally convert your int
representation of a Time (which i really recommend changing, there's a time
datatype specifically for storing times) to a time
. Then get the difference...
September 30, 2020 at 1:59 pm
Sorry for Oracle, yes, Execution Plan. I am not suggesting anything, yet asking for your opinion.
Then I don't understand your point here. You suggested that "Cross Apply was overkilling",...
September 30, 2020 at 1:49 pm
CROSS APPLY will affect show plan significantly on large JSON files.
CROSS APPLY
has nothing to do with the performance there; are you actually suggesting that OPENJSON
is slow?
By "show...
September 30, 2020 at 1:45 pm
Why do you think it's "overkilling"?
September 30, 2020 at 1:39 pm
If, however, you have valid JSON, then simply delimit identify the column names in your WITH
clause:
DECLARE @JSON nvarchar(MAX) = N'{
"Count":56,
...
September 30, 2020 at 1:19 pm
The JSON you've given us isn't even valid. If we take the time to format it properly, there's plenty of problems.
{
"count": 56,
...
September 30, 2020 at 1:13 pm
@AdjustMode -
it should Calculate the days between the dates as 0 Exclusive or 1 Inclusive of the (first day only).
but actually it excludes for both first day and end...
September 30, 2020 at 12:53 pm
Viewing 15 posts - 391 through 405 (of 5,111 total)