我似乎无法弄清楚为什么会出现以下错误:
Msg 2714, Level 16, State 5, Line 56
There is already an object named 'TPatients' in the database.
Msg 1750, Level 16, State 1, Line 56
Could not create constraint or index. See previous errors.
Run Code Online (Sandbox Code Playgroud)
下面是我的 Drop Table 和 Create Table SQL 语句。每当我执行时,它都会说 TPatients 已经存在,但是我在对象资源管理器中没有看到它。我尝试移动删除表语句,但无法使其工作。
-- --------------------------------------------------------------------------------
-- Step #1 : Drop tables
-- --------------------------------------------------------------------------------
IF OBJECT_ID ('TAppointments') IS NOT NULL DROP TABLE TAppointments
IF OBJECT_ID ('TPatients') IS NOT NULL DROP TABLE TPatients
IF OBJECT_ID ('TDoctors') IS NOT NULL …Run Code Online (Sandbox Code Playgroud)