|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Trouble with Insert Statements
Ok, I need some help with some SQL I'm writing. My tables are compiling just fine in MS SQL Server Query Analyser, however I'm getting an error when I try to run an insert statement. Below is the table I've created, then the insert statement I'm trying to run.
create table customer (customer_ID char(7) not null, customer_name char(30) not null, customer_street char(30) not null, customer_town char(30) not null, customer_county char(30) not null, customer_postcode char(8) not null, customer_telephone int not null, customer_email char(30) not null, constraint customerkey primary key (customer_ID), constraint cust_ID check ((customer_ID like '[0-9][0-9][0-9][-][0-9][0-9][0-9]')), constraint cust_postcode check ((customer_postcode like '[A-Z][A-Z][0-9][0-9][ ][0-9][A-Z][A-Z]') or (customer_postcode like '[A-Z][A-Z][0-9][ ][ ][0-9][A-Z][A-Z]')), constraint cust_phone check ((customer_telephone like '[0-9][0-9][0-9][0-9][0-9][ ][0-9][0-9][0-9][0-9][0-9][0-9]')), ); insert into customer values ('001-001','John Smith','4 Road Street','TownCity','TownCounty','TS10 2SW','01642 123456','John@smith.com'); |
|
#2
|
||||
|
||||
|
It would help to know what the error says!!
And why have you specified a telephone number field as an int??? It should be a text field. My bet is you are trying to input a text phone number, into an integer field. If so, change the phone field from int, to a varchar. Last edited by Memnoch : January 16th, 2005 at 10:48 PM. |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Trouble with Insert Statements |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|