Forum Replies Created

Viewing 15 posts - 391 through 405 (of 2,917 total)

  • Reply To: Fecth Max Date

    What you could do then is change your SQL to include a TOP(1) and an order by FailDate DESC. Will that solve your issue?

    Alternately, make your whole query a subquery...

    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: Fecth Max Date

    I think the easiest way to help you is if you can:

    1- provide sample data so we can run your query and get similar results

    2- provide expected output

    With point number...

    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: SQL Server Memory

    In that case, what you are likely more interested in is the page life expectancy. How long are pages estimated to remain in memory:

    https://www.sqlshack.com/page-life-expectancy-ple-in-sql-server/

    The lower the number, the more memory...

    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: SQL Server Memory

    I think that your "physical memory in use kb" is the number you are looking for, but even if things aren't running, stuff is in memory. SQL will keep things...

    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: Basic query performance

    Just wanted to point out that rmeldrum indicated in their script that temp tables put the results in memory. This is not accurate. Temp tables are written to tempdb which...

    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: ReportViewerControl.exportReport opening in new Window/Tab

    My opinion - I wouldn't make changes to the core SSRS files. My reasoning - you make all your changes and make things work exactly how you want and everyone...

    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: Column Name Is Different in Power BI Than SQL View

    As a completely random guess, are you renaming the column inside PowerBI at the presentation layer?

    As far as I am aware, PowerBI shouldn't be renaming columns on you.

    Alternately, any chance...

    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: Removing 'vote' from async secondary replica in AG

    Possibly a dumb question, but if secondary should never become primary, do you even need AG to be set up? Could you set up something like replication instead?

    As for having...

    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: Grouping based on chronological periods

    How is this (performance wise and for what you need):

    DECLARE @Histo AS DATE;
    SET @Histo = '1900-12-31';


    ;WITH Customers
    AS
    (
    ...

    • This reply was modified 2 years, 5 months ago by Mr. Brian Gale. Reason: converted tabs to spaces because the forum seems to hate tabs in code
    • This reply was modified 2 years, 5 months ago by Mr. Brian Gale.

    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: Grouping based on chronological periods

    I am glad you got it optimized. One thing that MAY also help with your optimization is to change your UNION to a UNION ALL. That will remove an implicit...

    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: Grouping based on chronological periods

    That is a long run time... so it sounds like it needs some optimizing.

    How much data are you working with and where are you presenting the data? If 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: Grouping based on chronological periods

    For handling it dynamically, I imagine it would be possible, but dynamic SQL is always risky. Since this would be a "write once and never again" (hopefully), my opinion 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: Grouping based on chronological periods

    There was some problems with your CTE's for the between_rows data due to the filter on RN=1. That shouldn't be applied on the between_rows set of data (happens higher up...

    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: copy or duplicate a folder in SSRS web portal

    Feel free to ask. In my experience, I haven't needed to use the import functionality before. I've exported when I needed a data dump of all my reports to disk...

    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: Grouping based on chronological periods

    This looks like a homework or assignment or an interview question, so you will forgive me for not just spitting out a full TSQL query for this. What is always...

    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 - 391 through 405 (of 2,917 total)