SQL判斷是否存在

1 判斷數據庫是否存在 2 ifexists(select*frommaster..sysdatabaseswherename=N’庫名’) 3 print’exists’ 4 else 5 print’notexists’ 6 7 --------------- 8 --判斷要建立的表名是否存在 9 ifexists(select*fromdbo.sysobjectswhere
相關文章
相關標籤/搜索