01-11-2014, 12:43 AM
سلام عليكم
تحقق من نوع الحقل ؟
غالبا ما يكون نوع الحقل int, bigint, smallint, tinyint, or decimal or numeric
والا ستواجه رسالة الخطأ التالية ان كنت تستخدم لغة SQL
ID حقل تعريفي + مفتاح اساسي
UserName حقل لا يقبل قيمة فارغة
UserAddress اختياري مثلا
تحقق من نوع الحقل ؟
غالبا ما يكون نوع الحقل int, bigint, smallint, tinyint, or decimal or numeric
والا ستواجه رسالة الخطأ التالية ان كنت تستخدم لغة SQL
إقتباس :Identity column 'ID' must be of data type int, bigint, smallint, tinyint, or decimal or numeric with a scale of 0, and constrained to be nonnullable.مثلا سوف انشيئ جدول table_test يحوي الحقول التالية
ID حقل تعريفي + مفتاح اساسي
UserName حقل لا يقبل قيمة فارغة
UserAddress اختياري مثلا
كود :
CREATE TABLE Table_Test
(ID [color=green]int[/color] not null [color=Blue]identity primary key[/color],UserName [color=Blue]varchar[/color](50) not null , UserAddress [color=Blue]varchar[/color](50) null)
