Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Object Relational Mapping
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
OCP Oracle Certified Professional Java SE 11 Developer Practice Tests
this week in the
OCP
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Paul Clapham
Jeanne Boyarsky
Ron McLeod
Tim Cooke
Sheriffs:
Devaka Cooray
paul wheaton
Mark Herschberg
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Frits Walraven
Jj Roberts
Bartenders:
Carey Brown
salvin francis
Piet Souris
Forum:
Object Relational Mapping
Check Constraint Help
Sherin Mathew
Ranch Hand
Posts: 94
posted 1 year ago
Number of slices to send:
Optional 'thank-you' note:
Send
Can i create Custom check constraint in SQL Server?
I have a table 'City' having columns as 'ID' , 'Name' and 'Number'.
If Name is 'AA' then Number column shouldn't accept null values. If name is other than 'AA' Number column can be null
.NET Developer at iFour Technolab Pvt LTd
Swastik Dey
Bartender
Posts: 2268
20
I like...
posted 1 year ago
Number of slices to send:
Optional 'thank-you' note:
Send
Does this solve your purpose
create table test (id varchar(10) primary key,name varchar(10),number varchar(10) CONSTRAINT MY_CONSTRAINT CHECK( CASE WHEN NAME = 'AA' THEN NUMBER NOT NULL END))
Swastik
Replace the word "snake" with "danger noodle" in all tiny ads.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Dealing with entities whose primary key exists as a compound key in two separate entities.
How to set the limit for primary keys
difference between foreign key & Join
Replacing *.hbm.xml files with @Annotations.
Can we add a Field(column) in a table dynamically?
More...