January 5, 2012 at 7:45 am
DDL for table
Create table dbo.email_template (
ID int not null,
template_name NVARCHAR(200) not null,
content ntext not null,
last_modified datetime null)
on [PRIMARY] ;
INSERT Statement
insert into dbo.email_template
(template_name, content, last_modified)
values ('GenericContactNoAddress.vm',
'This form was submitted from $serverName $formName
$firstName $lastName
$city $state
Preferred method of contact: $preferredMethodOfContact
Home Phone Number: $homePhone
Work Phone Number: $workPhone
Fax: $fax
Email Address: $email
My comments are:
$comments',
getDate()
);
Error:
Msg 515, Level 16, State 2, Line 1
Cannot insert the value NULL into column 'ID', table email_template'; column does not allow nulls. INSERT fails.
The statement has been terminated.
can anyone help?
January 5, 2012 at 7:57 am
The ID column is not identity column so it won't generate the value for missing (NOT NULL) column at the time of INSERT. Either declare the ID column as identity or insert the explicit values in INSERT statements.
January 5, 2012 at 8:23 am
I missed that.. THANK YOU!!!!
January 5, 2012 at 8:43 am
Jpotucek (1/5/2012)
I missed that.. THANK YOU!!!!
Most Welcome! 🙂
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply