Главная страница | назад





Article #20580: How SQL Links determines if an MSSQL table can refreshed.

Q. How does SQL Links determine if an MSSQL Table can be refreshed or not?

A. The following query is run when the table is opened:

select x.name, x.indid, x.status, INDEX_COL('owner.tablename', x.indid, c.colid) from sysindexes x, syscolumns c where x.id = object_id ('owner.tablename') and indid between 1 and 254 and x.id = c.id and c.colid <= x.keycnt order by x.indid, c.colid ASC

Note that owner and tablename are case sensitive.

Another query that is useful in working on this problem is listing all index for a table. The following query will do so:

SELECT b.* from dbo.sysobjects a, sysindexes b, sysusers c where a.name='tablename' and a.id=b.id and c.uid=a.uid and c.name='ownername'

Note that tablename and username are case sensitive.

Last Modified: 11-FEB-00