Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

Database Growth History Expand / Collapse
Author
Message
Posted Tuesday, May 7, 2013 9:11 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: 2 days ago @ 2:48 PM
Points: 70, Visits: 787
I had a syntax error also; a database name on my system is a reserved word. Fix the issue by surrounding the database name in the dynamic sql with square brackets.

EXEC ('
INSERT INTO ##tbl_DataSize
SELECT CAST((SUM(size)) as DECIMAL(20,3)) FROM ['+@vcDatabaseName+'].dbo.sysfiles'
)
Post #1450207
Posted Tuesday, May 7, 2013 10:06 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, April 11, 2014 3:53 AM
Points: 3, Visits: 70
Thank you - problem solved.
(Needed also brackets for DB name: '.....FROM ['+@vcDatabaseName+'].dbo.sysfiles')
Post #1450229
Posted Tuesday, May 7, 2013 4:12 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 6:52 PM
Points: 521, Visits: 785
Very nice script. Thanks.
Post #1450354
Posted Wednesday, May 8, 2013 8:32 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, July 25, 2014 3:13 PM
Points: 114, Visits: 452
Very nice script.

I noticed that some of those ungodly long-named SharePoint databases were getting their names chopped off so I changed the variable and the #temp table column names to VARCHAR(128)

CREATE TABLE #tbl_GrowthData
(
DatabaseName VARCHAR(128)
...
...


DECLARE
...
,@vcDatabaseName VARCHAR(128)




G. Milner
Post #1450865
Posted Monday, January 6, 2014 4:54 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, June 30, 2014 6:20 AM
Points: 6, Visits: 52
Hi,

Absolutely this is a nice script.

i have a small doubt in this. Please assist.

.. Is it possible to see the file wise growth of the each DB ?.

So that we can confidently say that So and so file in the particular disk has grown this much %.

Thanks,
Arjun

Post #1528038
Posted Monday, February 3, 2014 9:16 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, May 6, 2014 8:32 AM
Points: 31, Visits: 247
Thanks for sharing. Cool script.

You also might want to limit the data collection for only 'ONLINE' databases.

SELECT [name] FROM master.dbo.sysdatabases
WHERE DATABASEPROPERTYEX(name, 'status') = 'ONLINE'
ORDER BY [name]
OPEN file_cursor

~Leon
Post #1537378
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse