October 29, 2018 at 6:55 am
ebeng - Monday, October 29, 2018 5:00 AMThanks Jeff
Ill check out the Estimator also
Whether it fixes it or not, the Quirky Update is written incorrectly. Adding a unique index to the table could cause the next break. You also have no safety checks in them.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 29, 2018 at 11:12 am
Have scaled down the Compatibility level on his databases to 100 and this has sorted it for now until fixed
Have started the investigation on how to pickup all his quirky updates in code and agent jobs and replace with better structured code
Anyone know how I would go about doing that ?
October 29, 2018 at 11:17 am
ebeng - Monday, October 29, 2018 11:12 AMHave scaled down the Compatibility level on his databases to 100 and this has sorted it for now until fixed
Have started the investigation on how to pickup all his quirky updates in code and agent jobs and replace with better structured code
Anyone know how I would go about doing that ?
Did you check out Jason's code?
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
October 29, 2018 at 1:38 pm
Jason A. Long - Friday, October 26, 2018 2:11 PMThis will product the desired results without the need for temp tables or a quirky update...
WITH
cte_n1 (n) AS (SELECT 1 FROM (VALUES (1),(1),(1),(1),(1),(1),(1),(1),(1),(1)) n (n)),
cte_n2 (n) AS (SELECT 1 FROM cte_n1 a CROSS JOIN cte_n1 b),
cte_n3 (n) AS (SELECT 1 FROM cte_n1 a CROSS JOIN cte_n1 b),
cte_Tally (n) AS (
SELECT TOP (350000)
ROW_NUMBER() OVER (ORDER BY (SELECT a.n))
FROM
cte_n3 a CROSS JOIN cte_n3 b
)
SELECT
t.n
FROM
cte_Tally t.n;
I think the above code possibly has some issues. Are cte_n2 and cte_n3 supposed to be identical? And also, i think you want "FROM cte_Tally t", not "FROM cte_Tally t.n". Maybe this?WITH
cte_n1 (n) AS (SELECT 1 FROM (VALUES (1),(1),(1),(1),(1),(1),(1),(1),(1),(1)) n (n)),
cte_n2 (n) AS (SELECT 1 FROM cte_n1 a CROSS JOIN cte_n1 b),
cte_n3 (n) AS (SELECT 1 FROM cte_n2 a CROSS JOIN cte_n2 b), -- changed
cte_Tally (n) AS (
SELECT TOP (350000)
ROW_NUMBER() OVER (ORDER BY (SELECT a.n))
FROM
cte_n3 a CROSS JOIN cte_n3 b
)
SELECT
t.n
FROM
cte_Tally t; -- changed
October 29, 2018 at 2:40 pm
autoexcrement - Monday, October 29, 2018 1:38 PMJason A. Long - Friday, October 26, 2018 2:11 PMThis will product the desired results without the need for temp tables or a quirky update...
WITH
cte_n1 (n) AS (SELECT 1 FROM (VALUES (1),(1),(1),(1),(1),(1),(1),(1),(1),(1)) n (n)),
cte_n2 (n) AS (SELECT 1 FROM cte_n1 a CROSS JOIN cte_n1 b),
cte_n3 (n) AS (SELECT 1 FROM cte_n1 a CROSS JOIN cte_n1 b),
cte_Tally (n) AS (
SELECT TOP (350000)
ROW_NUMBER() OVER (ORDER BY (SELECT a.n))
FROM
cte_n3 a CROSS JOIN cte_n3 b
)
SELECT
t.n
FROM
cte_Tally t.n;I think the above code possibly has some issues. Are cte_n2 and cte_n3 supposed to be identical? And also, i think you want "FROM cte_Tally t", not "FROM cte_Tally t.n". Maybe this?
WITH
cte_n1 (n) AS (SELECT 1 FROM (VALUES (1),(1),(1),(1),(1),(1),(1),(1),(1),(1)) n (n)),
cte_n2 (n) AS (SELECT 1 FROM cte_n1 a CROSS JOIN cte_n1 b),
cte_n3 (n) AS (SELECT 1 FROM cte_n2 a CROSS JOIN cte_n2 b), -- changed
cte_Tally (n) AS (
SELECT TOP (350000)
ROW_NUMBER() OVER (ORDER BY (SELECT a.n))
FROM
cte_n3 a CROSS JOIN cte_n3 b
)
SELECT
t.n
FROM
cte_Tally t; -- changed
You are correct... Not sure how I let that through without noticing... Sorry about that. :crying:
I've corrected the original post.
November 1, 2018 at 4:10 am
Hi
Thanks Jason
Yes I passed it onto the person doing the quirky updates
Now just to find a way to pickup all hes quirky updates
Thanks for all the help
E
Viewing 6 posts - 16 through 20 (of 20 total)
You must be logged in to reply to this topic. Login to reply