Hi @Salooja Johnson , welcome to Microsoft Q&A forum.
Can you please try running queries in below format once and let me know if it works:
SELECT * FROM sys.dm_db_index_physical_stats (DB_ID(N'yourdbname'), NULL, NULL, NULL , 'LIMITED');
SELECT * FROM sys.dm_db_index_physical_stats (DB_ID(N'yourdbname'), NULL, NULL, NULL , 'DETAILED');
Just replace the database name.
If this does not work, could you please provide a screenshot of the error? Also is this an old database or something you have created recently.