原文:sqlserver各種判斷是否存在(表、視圖、函數、字敦、索引、存儲過程)

判斷表是否存在 select from sysobjects where id object id 表名 and OBJECTPROPERTY id, N IsUserTable 判斷視圖是否存在 select table name from information schema.views where table name 視圖名 或者 SELECT FROM dbo.sysobjects W ...

2021-05-10 15:06 0 1132 推薦指數:

查看詳情

MySQL判斷索引是否存在存儲過程

創建mysql數據庫時需要創建索引,但是mysql並不有drop index index_name if exists on table_name這樣的語法,所以寫一個存儲過程判斷,如果存在就刪除后再創建新的索引存儲過程如下: ---- procedure of delete ...

Mon Jan 07 23:55:00 CST 2013 0 6204
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM