我正在Sybase 15 SQL中使用存儲過程。我想確定一個臨時#table的索引。通常的技術在永久桌子上工作,但不在臨時桌子上工作:如何查找Sysbase中#table中是否存在索引?
--look for an index on a temporary table
create table #T1(duff int)
create index idx99 on #T1(duff)
select * from sysindexes where name = 'idx99' --returns null rows !
--Look for an index on a permanent table
create table T1(duff int)
create index idx99 on T1(duff)
select * from sysindexes where name = 'idx99' --returns a row. OK for perm table.
任何想法?
鮑勃
這可能適合在這裏很好,我想:http://stackoverflow.com/questions/1468183/how-i-can-find-the-list-of-sybase-indexes-for-a-given - 數據庫 – LWNirvana
@LWNirvana它很近。主要區別在於臨時表將其信息保存在臨時數據庫中。 –
@ user3041581嗨,我注意到你還沒有接受我的答案,只是想跟進。 –