Viewing 15 posts - 1,996 through 2,010 (of 2,917 total)
I think my only question here is what do you consider a "valid" revised start/end dates? for example, if you had this:
start end
Dec 1,2020...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 29, 2020 at 5:41 pm
If I understand that script correctly, you are essentially doing a find and replace with a large list of characters to swap out, correct? If the character is "aù", you...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 29, 2020 at 5:36 pm
You could use "location" still, but put []'s around it too. My habit is to put [] around my objects. Never know when a new version of SQL will add...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 29, 2020 at 5:28 pm
I don't think telling SQL it can use more memory is the way to go when you are possibly having memory pressure already. If I understood you correctly you said...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 29, 2020 at 4:25 pm
Changing your "UNION ALL"s to "UNION"s so you remove duplicates in the recursive lookup may help.
I also agree with Scott here that you should update your joins to be in...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 29, 2020 at 3:29 pm
your available physical memory is pretty low, and I am pretty sure that SQL won't run on Virtual memory. My guess here (without seeing your system) is you are out...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 28, 2020 at 10:05 pm
I see you have quite a large chunk of code there and from a quick eyeballing of it, is it duplicated code? Do you really need to go through those...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 28, 2020 at 7:57 pm
I am glad to help. I am glad that fixed the issue too (hopefully).
Sorry the code isn't more efficient. I'm sure there are others on the forum who could look...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 28, 2020 at 5:38 pm
Think I see my typo... try changing:
BEGIN
IF NOT EXISTS
(
SELECT
1
FROM@result
WHERE[tripID] = @tripID2
)
BEGIN
SELECT
@correctedLoop = [grouping]
FROM@result
WHERE[tripID] = @tripID2;
END
ELSE
BEGIN
SELECT @correctedLoop = [grouping]
FROM @result
WHERE...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 28, 2020 at 3:43 pm
As a weird thought, are you sure they are duplicates? You said that it wasn't until you opened up a wider date range... I am wondering if MAYBE it is...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 28, 2020 at 2:11 pm
I have a thought on that... I think I missed one of the "sanity" checks in the CURSOR... try this:
;WITH [cte]
AS
(
SELECTDISTINCT
[t].[rn] AS [rn]
, [t].[ldate] AS...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 27, 2020 at 10:03 pm
From the Microsoft documentation to enable query store on SQL 2016:
ALTER DATABASE [QueryStoreDB]
SET QUERY_STORE = ON
(
OPERATION_MODE =...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 27, 2020 at 4:40 pm
I think the issue is Scott's query has a typo:
INNER JOIN #Duplicate D ON D.ID = D_First.ID AND D.Market = D_First.PL AND
should be:
INNER JOIN...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 27, 2020 at 3:28 pm
How does this look:
WITH cte AS (
SELECT [id]
, [Father_id]
, [Flag_Root]
, root = [id]
, 0 AS N
FROM @tab
WHERE [Flag_Root] = 1
UNION ALL
SELECT [t].[id], [t].[father_id], [t].flag_root,...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 24, 2020 at 8:11 pm
I am glad I could help! I found the problem to be interesting and fun to work on.
Been a while since I had a fun, challenging SQL query like that...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
April 24, 2020 at 5:59 pm
Viewing 15 posts - 1,996 through 2,010 (of 2,917 total)