How do you disable the INSPECT ELEMENT option in the menu from Chrome and Firefox etc?
67
type in about:config
in your address bar and find devtools.inspector.enabled
and set it to false
Related videos on Youtube
Author by
Hawtinjr
Updated on September 18, 2022Comments
-
Hawtinjr over 1 year
Product: SQL Server
Is it possible to write a constraint, that checks the values of other columns? In my specific case I will give you an example:
Let's imagine I have a table with 5 Columns:
Name | Hobby1 | Hobby2 | Hobby3 | Hobby4
Lets say there are the following values in it:
John Doe| fishing | reading| swimming| jogging
What I try to reach is the following: If someone trys to Insert : John Doe, fishing,reading
It should be blocked, cause I don't want the same combination in the first 3 Columns.
Can I realise that with a constraint or do I need a Primary key combination for the first 3 columns?
Thanks for your replies.
-
jarlh over 7 yearsPoor table design. Have one hobby column, and several rows instead.
-
N00b Pr0grammer over 7 yearsCreate a UNIQUE CONSTRAINT with the three columns that you are referring to be unique, though you could think of a better design.
-
Hawtinjr over 7 yearsThat was just to simplify the matter, I dont have such a table structure in my DB. Thanks for your reply!
-
Serg over 7 yearsYes, Primary key including first 3 columns may be exactly the constraint you need. Alternatively it should be UNIQUE constraint if some of them are nullable, plus PRIMARY on
name NOT NULL
only. -
Hawtinjr over 7 yearsYes of course i need this feature, cause my 3rd column can sometimes be NULL. Can you secify this please? So the idea with the Primary key was not good for this usecase
-
onedaywhen over 7 years@jarlh: when the requirement is always have exactly five hobbies then the OP's design is superior because SQL Server cannot check constraints across rows (but can across columns of the same row).
-
jarlh over 7 yearsHave constraints to make sure hobby1 < hobby2 < ... hobby5, i.e alphabetic order.
-
Unnikrishnan R over 7 yearsHow you are going to inserting data in to your table? if by procedure you can add a data existence check inside your procedure before the insert.. Otherwise you can set up unique check constraint across all three columns.
-
The Shooter over 7 yearsAs @jarlh has mentioned poor table design. Have a table where you have names and create an id column. Create another table to store hobbies. Create third table to store mapping of names to hobbies.
-
-
TheBlackBenzKid about 12 yearsWorks! Thank you. I thought I would have to restart browser. Updated my Question...
-
Hawtinjr over 7 yearsHi, thanks for your reply. What if there are NULLS in my third column? can i overcome this so that : John Doe, fishing, NULL ; John Doe, fishing, NULL will be accepted?
-
StackUser over 7 yearsUnique constraint allow null once