January 21, 2008 at 9:49 am
Can anyone tell me why the following query will run against a database with a compatibility level of 90 but not 80?
SELECT BytesOnDisk FROM ::fn_virtualfilestats((DB_ID()), 1)
The error message being:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '('.
Both functions are available in SQL 2000 so I don't understand why this is returning an error.
Thanks in advance.
January 22, 2008 at 1:35 am
Try with the following gives the current database status
Select bytesondisk from fn:virtualfilestats(1,1);
January 22, 2008 at 2:28 am
The reason is that SQL Server 2000 has much stricter rules on what it allows as parameters to table returning functions. So no function results, no variables, .... SQL Server 2005 has removed this limitation.
Regards,
Andras
January 22, 2008 at 3:30 am
That doesn't give the size of the current database. It relates to the database with an ID of 1.
I took the information from sys.sysaltfiles instead but thanks for the replies.
November 27, 2013 at 3:13 am
You could change the SQL compatibility setting from sql 2000 to 2005, if the app will allow it?
I have never come across an app that has issues with an higher setting, but that is no guarantee 🙂
November 27, 2013 at 3:36 am
Please note: 6 year old thread
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply