Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Hinduson
Yak Posting Veteran
69 Posts |
Posted - 2013-09-27 : 12:11:11
|
Please can someone help me out with how to create this table in sql.Table : supplier.supplierDetails*SupplierID must be auto generated.*FirstName,LastName,Address,Phone, and Country should not be left Blank*Phone number must be in the following format.'[0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9]'Best Regards. |
|
djj55
Constraint Violating Yak Guru
352 Posts |
Posted - 2013-09-27 : 13:08:43
|
For SupplierID use IDENTITYFor the name and address use NOT NULLSorry I cannot remember how to do the validation for the phone number.CREATE TABLE yourtablename (SupplierID INT IDENTITY(1,1), FirstName VARCHAR(100) NOT NULL,... djj |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-09-27 : 15:18:28
|
and for phone number column:....,phoneno CHAR(19)CHECK (phoneno LIKE '[0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9]') |
|
|
Hinduson
Yak Posting Veteran
69 Posts |
Posted - 2013-09-28 : 04:41:35
|
Thanks James K .. Letme try it outBest Regards. |
|
|
|
|
|