Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #894 > unrolled thread

indexes

Started by"m" <web12master@gmail.com>
First post2012-01-09 15:34 +0100
Last post2012-01-10 08:39 +0100
Articles 3 — 2 participants

Back to article view | Back to comp.databases.ms-sqlserver


Contents

  indexes "m" <web12master@gmail.com> - 2012-01-09 15:34 +0100
    Re: indexes Erland Sommarskog <esquel@sommarskog.se> - 2012-01-09 23:33 +0100
      Re: indexes "m" <web12master@gmail.com> - 2012-01-10 08:39 +0100

#894 — indexes

From"m" <web12master@gmail.com>
Date2012-01-09 15:34 +0100
Subjectindexes
Message-ID<jeett7$h4p$1@gregory.bnet.hr>
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 

[toc] | [next] | [standalone]


#895

FromErland Sommarskog <esquel@sommarskog.se>
Date2012-01-09 23:33 +0100
Message-ID<Xns9FD5EF9621647Yazorman@127.0.0.1>
In reply to#894
m (web12master@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, esquel@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

[toc] | [prev] | [next] | [standalone]


#896

From"m" <web12master@gmail.com>
Date2012-01-10 08:39 +0100
Message-ID<jegput$v6f$1@gregory.bnet.hr>
In reply to#895
Thank you.

"Erland Sommarskog" <esquel@sommarskog.se> wrote in message 
news:Xns9FD5EF9621647Yazorman@127.0.0.1...
>m (web12master@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, esquel@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
> 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.databases.ms-sqlserver


csiph-web