Graph multiple databases growth using SSMS only

  • Comments posted to this topic are about the item Graph multiple databases growth using SSMS only

  • Is this related to a specific version of SQL Server?

    I've just run it on SQL 2016 and the STRING_AGG method is unknown.

  • Nevermind, I've just googled STRING_AGG and it's only available from SQL2017+

  • Did you leave out a step? What do you do w/the results?

  • Hi dplaut 49149, after plotting the data I tell my customer which databases are growing fast and the space requirement for next month, with a graph. I can also tell them which databases never grow so there's no need to provision space for them. And they prefer a graphic over a number, that's why I generate it that way. I also tell them which server is needing the most space when I run it as a multi-server query.

  • Hi matthew.cartwright, you can use "FOR XML" and "STUFF" to generate a string out of multiple rows, you can find an example in this tip where I did the same: https://www.mssqltips.com/sqlservertip/5169/sql-server-parallelism-overview/. The GEOMETRY datatype exists since SQL Server 2008 and SSMS plots it.

  • Sorry, I'm being dense.

    I see results like the below and I don't know what to do w/ it.

    0x000000000114000000000000000025AE635C713103400000000000805640138255F5F2BB0740

  • Hi dplaut 49149, just ignore them, these are GUID for the graphics generated in another tab, just switch to the plotted graphics.

  • Thanks, got it. I did not notice the tab and didn't even know about that feature. Thanks, I've learned a lot.

  • Hi Pablo, can you please the script that helps plot the graphs, I am not so strong in this stuff, thanks

  • Hi eliassal, can you please clarify your request?

  • You indicate in one of your links "the storage needs for the next 45 days using the instructions "Forecasting, Identifying Trends with Linear Regression · Advanced SQL · SILOTA", how this will be done in SSMS, not in R?

     

  • Hi eliassal, this is calculated in the CTEs named [slope] (calculates m) and [lr] (linear regression), then you can see in the next statement it is grouped by [m] and to complete the form y=mx+b. Please let me know if it clarifies your question.

  • So many thanks, but how we can get data to used in excel and not spatial?

  • Not totally sure I understand your question, but if you're wondering how to get the data from your stored procedure into Excel, it's pretty easy.

    Go to Data tab, Get Data, from SQL Server.

    Then you get Server, Database, and there's an "Advanced Options" part - click the down arrow thing. A textbox will appear... Copy & Paste the T-SQL statement there. Could be EXEC storedProc param1... or a query. Run and it will pull the data returned into Excel for you, and then you can graph it.

Viewing 15 posts - 1 through 15 (of 20 total)

You must be logged in to reply to this topic. Login to reply