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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 check constraint help

Author  Topic 

bmgtone
Starting Member

5 Posts

Posted - 2015-05-05 : 12:29:47
I have a table where i have to make a check constraint that states the first 3 characters of the customerid field must be the first 3 characters of the company name I am so lost I looked everywhere. can someone give me an idea or tell me where to look for this answer thankyou

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2015-05-05 : 12:53:29
CHECK (SUBSTRING(CustomerID, 1, 3) = SUBSTRING(CompanyName, 1, 3))



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

bmgtone
Starting Member

5 Posts

Posted - 2015-05-05 : 13:40:20
Thankyou so much
Go to Top of Page
   

- Advertisement -