The INSERT statement conflicted with the CHECK constraint "ck_str_member_no
". The conflict occurred in database "C:\DOCUMENTS AND SETTINGS\KARTHIKEYAN\DESKTOP\KOK\DB\INFT3009_ASS1_C3104855.MDF", table "dbo.Members", column 'str_member_no
'.
The statement has been terminated.
I am using .MDF file in my visual studio 2008 Express. How do I solve it?
My insert Procedure :
ALTER PROCEDURE [dbo].[AddNewAGCMember]
-- Add the parameters for the stored procedure here
@str_member_no varchar(6) = '',
@str_member_name varchar(50) = '',
@str_member_password varchar(10) = '',
@str_addr_apartment_no varchar(10) = NULL,
@str_addr_building_name varchar(50) = NULL,
@str_addr_street_name varchar(50) = NULL,
@int_postal_code int = NULL,
@str_country_name varchar(50) = NULL,
@int_contact_no int = NULL,
@str_email_addr varchar(100) = '',
@date_registration date = ''
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
INSERT INTO Members
(str_member_no,
str_member_name,
str_member_password,
str_addr_apartment_no,
str_addr_building_name,
str_addr_street_name,
int_postal_code,
str_country_name,
int_contact_no,
str_email_addr,
date_registration)
VALUES
(@str_member_no,
@str_member_name,
@str_member_password,
@str_addr_apartment_no,
@str_addr_building_name,
@str_addr_street_name,
@int_postal_code,
@str_country_name,
@int_contact_no,
@str_email_addr,
@date_registration);
END
Table structure :
str_member_no
, varchar(6), Uncheckedstr_member_name
, varchar(50), Uncheckedstr_member_password
, varchar(10), Uncheckedstr_addr_apartment_no
, varchar(10), Checkedstr_addr_building_name
, varchar(50), Checkedstr_addr_street_name
, varchar(50), Checkedint_postal_code
, int, Checkedstr_country_name
, varchar(50), Checkedint_contact_no
, int, Checkedstr_email_addr
, varchar(100), Uncheckeddate_registration
, date, UncheckedUnchecked