January 24, 2019 at 6:19 am
Hello,
I'm trying to run the following query in Microsoft SQL Server Management Studio 17. But I keep getting an error. Can anybody help me figuring out what I'm doing wrong here. Thanks in advance.
SELECT *
FROM sys.dm_db_index_physical_stats(db_id(*name database*), object_id(*name table*), NULL, NULL, 'detailed');
I also tried the following query's, but none seem to work.
SELECT *
FROM sys.dm_db_index_physical_stats(db_id(*name database*), object_id(*name table*), NULL, NULL, detailed);
SELECT *
FROM sys.dm_db_index_physical_stats(db_id(*name database*), object_id(*name table*), NULL, NULL, NULL);
January 24, 2019 at 6:24 am
sarahmp - Thursday, January 24, 2019 6:19 AMHello,
I'm trying to run the following query in Microsoft SQL Server Management Studio 17. But I keep getting an error. Can anybody help me figuring out what I'm doing wrong here. Thanks in advance.SELECT *
FROM sys.dm_db_index_physical_stats(db_id(*name database*), object_id(*name table*), NULL, NULL, 'detailed');I also tried the following query's, but none seem to work.
SELECT *
FROM sys.dm_db_index_physical_stats(db_id(*name database*), object_id(*name table*), NULL, NULL, detailed);
SELECT *
FROM sys.dm_db_index_physical_stats(db_id(*name database*), object_id(*name table*), NULL, NULL, NULL);
What error are you getting? The first one works for me.
Thanks
January 24, 2019 at 6:34 am
Thanks for responding. The error I'm getting is:
Msg 102, Level 15, State 1, Line 2
Incorrect syntax
It also says: An insufficient number of arguments were supplied for the procedure or function sys.dm_db_index_physical_stats.
January 24, 2019 at 6:40 am
This what I'm running (Database Name and Object Name have been changed):
SELECT *
FROM sys.dm_db_index_physical_stats(db_id('dba_database'), object_id('DDL_EVENTS'), NULL, NULL, 'detailed');
Are you running it on a SQL Server 2017 database?
Thanks
January 24, 2019 at 7:01 pm
sarahmp - Thursday, January 24, 2019 6:19 AMHello,
I'm trying to run the following query in Microsoft SQL Server Management Studio 17. But I keep getting an error. Can anybody help me figuring out what I'm doing wrong here. Thanks in advance.SELECT *
FROM sys.dm_db_index_physical_stats(db_id(*name database*), object_id(*name table*), NULL, NULL, 'detailed');I also tried the following query's, but none seem to work.
SELECT *
FROM sys.dm_db_index_physical_stats(db_id(*name database*), object_id(*name table*), NULL, NULL, detailed);
SELECT *
FROM sys.dm_db_index_physical_stats(db_id(*name database*), object_id(*name table*), NULL, NULL, NULL);
If you're using that exact same code and substituting the names, then the problem is likely the "*" that you're using instead of single quotes.
Word of advice for future posts... post the actual error that you're getting. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
January 27, 2019 at 6:32 am
Thank you both. The problem was indeed in the quotations.
January 27, 2019 at 7:27 am
sarahmp - Sunday, January 27, 2019 6:32 AMThank you both. The problem was indeed in the quotations.
Thank you for the feedback and the confirmation.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply