Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

indexes

3 views
Skip to first unread message

m

unread,
Jan 9, 2012, 9:34:15 AM1/9/12
to
Hello,

I've been trying to run this sql:

SELECT b.fill_factor, b.type_desc, a.index_id, b.name,
a.avg_fragmentation_in_percent, a.avg_page_space_used_in_percent

FROM sys.dm_db_index_physical_stats ( DB_ID() , NULL, NULL, NULL, NULL) AS a

JOIN sys.indexes AS b ON a.object_id = b.object_id AND a.index_id =
b.index_id;

We have few database on our server.

On most of them this sql statement works fine, but on few of them I got
error

Msg 102, Level 15, State 1, Line 8

Incorrect syntax near '('.

What could be a problem?

I don't get it? The statement is exactly the same, once it works fine, next
time there is error?!

Thanks in advance


Erland Sommarskog

unread,
Jan 9, 2012, 5:33:08 PM1/9/12
to
m (web12...@gmail.com) writes:
> I've been trying to run this sql:
>
> SELECT b.fill_factor, b.type_desc, a.index_id, b.name,
> a.avg_fragmentation_in_percent, a.avg_page_space_used_in_percent
>
> FROM sys.dm_db_index_physical_stats ( DB_ID() , NULL, NULL, NULL, NULL) AS a
>
> JOIN sys.indexes AS b ON a.object_id = b.object_id AND a.index_id =
> b.index_id;
>
> We have few database on our server.
>
> On most of them this sql statement works fine, but on few of them I got
> error
>
> Msg 102, Level 15, State 1, Line 8
>
> Incorrect syntax near '('.
>
> What could be a problem?

These databases are in compatibility mode 80.


--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx

m

unread,
Jan 10, 2012, 2:39:09 AM1/10/12
to
Thank you.

"Erland Sommarskog" <esq...@sommarskog.se> wrote in message
news:Xns9FD5EF962...@127.0.0.1...
0 new messages