January 8, 2016 at 10:00 am
Comments posted to this topic are about the item History of the size of the database files
February 17, 2016 at 4:46 pm
Thanks for the script.
July 11, 2016 at 6:04 am
Msg 195, Level 15, State 10, Procedure SaveHistoryDBfileSize, Line 83 [Batch Start Line 2]
'CAHAR' is not a recognized built-in function name.
April 21, 2017 at 6:14 am
When I run the script under SQL Server 2012 Standard Edition, I get the following errors:
Error message: Incorrect syntax near '/'.
Error number = 102
Error Procedure: '---
Error Line = 12
Please advise. (Note that I changed the TEST database to the MASTER database and I am running with SA privileges).
April 21, 2017 at 7:09 am
martindnovak - Friday, April 21, 2017 6:14 AMWhen I run the script under SQL Server 2012 Standard Edition, I get the following errors:Error message: Incorrect syntax near '/'.
Error number = 102
Error Procedure: '---
Error Line = 12
Please advise. (Note that I changed the TEST database to the MASTER database and I am running with SA privileges).
Hi!
I think that the reason is not in SQL2012, but in that my procedure uses CLR function drive_info.
This CLR needs to be pre-installed for your database.
In the description of my procedure (SaveHistoryDBfileSize), I did not explain the process of creating the CLR function.
I just noted the link (https://www.mssqltips.com/sqlservertip/1986/sqlclr-function-to-return-free-space-for-all-drives-on-a-server/) on a good article that I used himself.
Do not use the master database for the experiments. It is better to create your own base.
April 21, 2017 at 7:13 am
There is also a missing bracket in this line;
CAST(mf. AS DECIMAL(38, 0)/128. AS [FileSizeMB]
It should be;
CAST(mf. AS DECIMAL(38, 0))/128. AS [FileSizeMB]
And yes you need to create the CLR procedure as well.
Rodders...
April 21, 2017 at 7:28 am
I now have a new error:
Msg 102, Level 15, State 1, Procedure SaveHistoryDBfileSize, Line 1
Incorrect syntax near 'SaveHistoryDBfileSize'.
April 21, 2017 at 8:46 am
rodjkidd - Friday, April 21, 2017 7:13 AMThere is also a missing bracket in this line;
CAST(mf. AS DECIMAL(38, 0)/128. AS [FileSizeMB]
It should be;
CAST(mf. AS DECIMAL(38, 0))/128. AS [FileSizeMB]
And yes you need to create the CLR procedure as well.
Rodders...
Tanks, Rodders!
April 21, 2017 at 9:23 am
oops, missed the part about the CLR procedure. I will look into that.
Thanks.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply