原文:判断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