Forum Replies Created

Viewing 15 posts - 1,996 through 2,010 (of 2,917 total)

  • Reply To: create new table from two others but have consistent date ranges

    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.

  • Reply To: Convert VBA function to SQL function

    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.

  • Reply To: Object naming

    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.

  • Reply To: DBCC Integrity Check Error - insufficient system memory in resource pool

    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.

  • Reply To: Pefromance help for transaction derrivation

    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.

  • Reply To: DBCC Integrity Check Error - insufficient system memory in resource pool

    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.

  • Reply To: Pefromance help for transaction derrivation

    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.

  • Reply To: Identifying a grouping within a group of overlapping times?

    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.

  • Reply To: Identifying a grouping within a group of overlapping times?

    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.

  • Reply To: Identifying a grouping within a group of overlapping times?

    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.

  • Reply To: Identifying a grouping within a group of overlapping times?

    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.

  • Reply To: Scripting Query Store

    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.

  • Reply To: Update duplicate values to 0

    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.

  • Reply To: Parent-Child Hierarchy - Finding the root

    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.

  • Reply To: Identifying a grouping within a group of overlapping times?

    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.

Viewing 15 posts - 1,996 through 2,010 (of 2,917 total)