![](/img/trans.png)
[英]Tridion : How can I find out if a page has been published to a particular publication target using the business connector?
[英]How can I find out if an index has been created on a SQLite table?
我正在使用此代碼來創建和索引。 我意識到如果它已經存在就不會創建它,但是有人可以告訴我有沒有辦法找出索引是否已經創建?
db2.Execute("CREATE UNIQUE INDEX IF NOT EXISTS idx_History on History(YYMMDD,Mode,Quiz,CC,Deck)");
您可以使用內部sqlite_master
表並查詢您的索引:
var result = await conn.ExecuteScalarAsync<int>("SELECT count(*) FROM sqlite_master WHERE type='index' and name=?;", new string[] { "someIndexName" });
if (result == 1)
{
~~~
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.