開始使用免費開始

錯誤結構複習

當你執行以下指令碼:

INSERT INTO products (product_name, stock, price)
    VALUES ('Trek Powerfly 5 - 2018', 10, 3499.99);

你的 SQL Server 主控台會顯示:

Msg 2627, Level 14, State 1, Line 1
Violation of UNIQUE KEY constraint 'unique_name'. 
Cannot insert duplicate key in object 'dbo.products'. 
The duplicate key value is (Trek Powerfly 5 - 2018).

從左到右,你拿到的錯誤訊息由哪些部分組成?

本練習屬於課程

SQL Server 的交易與錯誤處理

檢視課程

動手互動練習

將理論付諸實踐,立即體驗我們的互動練習

開始練習