Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

69 Posts

Posted - 09/27/2013 :  12:11:11  Show Profile  Reply with Quote
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.

Best Regards.

Constraint Violating Yak Guru

352 Posts

Posted - 09/27/2013 :  13:08:43  Show Profile  Reply with Quote
For SupplierID use IDENTITY
For the name and address use NOT NULL
Sorry 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,...

Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 09/27/2013 :  15:18:28  Show Profile  Reply with Quote
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]')
Go to Top of Page

Yak Posting Veteran

69 Posts

Posted - 09/28/2013 :  04:41:35  Show Profile  Reply with Quote
Thanks James K .. Letme try it out

Best Regards.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000