Answer by Valentino Vranken
I assume your table has got a column called **Gender** and its type is *char(1)*. And you're asking how to prevent incorrect values from getting inserted into that table. Correct values are M and W,...
View ArticleAnswer by ThomasRushton
I agree to some extent with what @Valentino Vranken says; however, the database should also protect itself against incorrect data. You can do this using CONSTRAINTs - in this case, a [CHECK...
View ArticleAnswer by ruancra
create proc TEST @Variable varchar(20) AS BEGIN IF @Variable = 'M' Select Column as 'Male' from Table where Column like 'M%' IF @Variable = 'W' Select Column as 'Male' from Table where Column like 'W%'...
View ArticleAnswer by Valentino Vranken
I assume your table has got a column called **Gender** and its type is *char(1)*. And you're asking how to prevent incorrect values from getting inserted into that table. Correct values are M and W,...
View ArticleAnswer by ThomasRushton
I agree to some extent with what @Valentino Vranken says; however, the database should also protect itself against incorrect data. You can do this using CONSTRAINTs - in this case, a [CHECK...
View ArticleAnswer by ruancra
create proc TEST @Variable varchar(20) AS BEGIN IF @Variable = 'M' Select Column as 'Male' from Table where Column like 'M%' IF @Variable = 'W' Select Column as 'Male' from Table where Column like 'W%'...
View Article
More Pages to Explore .....