| sp_addtype | ใช้สร้างประเภทของข้อมูลขึ้นมาเอง เพื่อลดความซ้ำซาก จะได้ไปประกาศที่เดียวเลย ในเมื่อใช้เหมือนกัน |
|---|
subject:sp_addtype
syntax:sp_addtype [ @typename= ] typename, [ @phystype= ] system_data_type [, [ @nulltype= ] "null_type" ] [, [ @owner= ] "owner_name" ]
content:ใช้สร้างประเภทของข้อมูลขึ้นมาเอง เพื่อลดความซ้ำซาก จะได้ไปประกาศที่เดียวเลย ในเมื่อใช้เหมือนกัน
example:exec sp_addtype budget, "decimal(9,2)", "null" CREATE TABLE tbl_orders ( id int IDENTITY NOT NULL, budget_january budget NOT NULL, budget_feburary budget NOT NULL, )