Link to home
Create AccountLog in
Avatar of MediaBanc
MediaBanc

asked on

Index Physical Stats

Hi Experts!

I would like to ask, what could be wrong with this procedure:

USE iass_ent3
GO
SELECT object_id, index_id, avg_fragmentation_in_percent, page_count
FROM sys.dm_db_index_physical_stats(DB_ID('iass_ent3'),
OBJECT_ID('dbo.ad_master'), NULL, NULL, NULL);

Open in new window


it returns:

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '('.

In my other database server, I just changed the database name and table name, the procedure is working fine.

Thank you.
Avatar of Racim BOUDJAKDJI
Racim BOUDJAKDJI
Flag of Algeria image

please make sure the current compatibility of iass_ent3 is at least 90.
ASKER CERTIFIED SOLUTION
Avatar of Racim BOUDJAKDJI
Racim BOUDJAKDJI
Flag of Algeria image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
As Racimo has pointed out the function dm_db_index_physical_stats() was not available prior to SQL Server 2005.