{"id":3418,"date":"2015-12-16T09:52:56","date_gmt":"2015-12-16T14:52:56","guid":{"rendered":"https:\/\/academy.sqlbak.com\/?p=3418"},"modified":"2023-10-17T05:05:18","modified_gmt":"2023-10-17T09:05:18","slug":"unknown-object-type-used-in-a-create-drop-or-alter-statement-msg-343","status":"publish","type":"post","link":"https:\/\/academy.sqlbak.com\/unknown-object-type-used-in-a-create-drop-or-alter-statement-msg-343\/","title":{"rendered":"Unknown object type ‘…’ used in a CREATE, DROP, or ALTER statement (Msg 343)"},"content":{"rendered":"
Let’s consider the error “Unknown object type ‘…’ used in a CREATE, DROP, or ALTER statement”\u00a0<\/em>in the following example:<\/p>\n There is a need to add one more column “Column4” in the table “Table_1” which is located in the database “Adventureworks”. To execute this operation has been used the next syntax<\/p>\n <\/p>\n But the column was not added, and the SQL Server showed the following message:<\/p>\n This error occurs because SQL Server does not understand what to ALTER. In this case, it is necessary just to add TABLE after ALTER<\/p>\n Let’s consider the error “Unknown object type ‘…’ used in a CREATE, DROP, or ALTER statement”\u00a0in the following example: There is a need to add one more column “Column4” in the table “Table_1” which is located in the database “Adventureworks”. To execute this operation has been used the next syntax ALTER Table_1 ADD Column4 INT;<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[159],"tags":[],"yoast_head":"\nALTER<\/span> Table_1 \r\nADD<\/span> Column4 INT<\/span>;<\/pre>\n
Msg 343, Level 15, State 1, Line 3<\/span>\r\nUnknown object type 'Table_1' used in a CREATE, DROP, or ALTER statement.<\/span><\/pre>\n
ALTER TABLE<\/span> Table_1 \r\nADD<\/span> Column4 INT<\/span>;<\/pre>\n","protected":false},"excerpt":{"rendered":"