原文:判斷sql對象是否存在,不存在就創建

創建主鍵IF NOT EXISTS select name from dbo.sysobjects where xtype PK and parent obj select id from dbo.sysobjects where name Employee BEGIN ALTER TABLEEmployee ADD PRIMARY KEY Id ENDGO 創建外鍵 IF NOT EXISTS ...

2020-08-19 19:14 0 504 推薦指數:

查看詳情

 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM