2016年11月8日 星期二

超過 249 個非叢集索引或資料行統計資料

SQL Server 2000,一個資料表上要建立索引時,出現以下訊息,

不得在一個資料表上建立超過 249 個非叢集索引或資料行統計資料

Cannot create more than 249 nonclustered indices or column statistics on one table.


 先查看索引數,當然不可能有249個,所以查詢了統計資訊。

select 'drop statistics '+object_name(a.id)+'.'+a.name 
   from  sysindexes a inner join .sysindexkeys b
     on a.id = b.id and a.indid = b.indid inner join syscolumns  c
     on b.id = c.id and b.colid = c.colid
  where indexproperty(a.id, a.name, 'IsStatistics') = 1 
    and object_name(a.id) = 'your_table'  


先確認是否已有249個統計值,如果有,就先刪除不要的,再建一次index應該就行了。

VS CODE離線安裝套件方式-續

去年 vscode離線安裝 powershell nupkg 今年在一台無外網的 windwos 2025上安裝時遇到了powershell版本一直讀取到了5.1的版本,鬼打牆了一下午,在VM還原重測測了好幾回,應該是可行了。 將下載到的免安裝powershell 解壓縮到...