Quantcast
Channel: Answers for "Syntax helps"
Browsing all 6 articles
Browse latest View live

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 Article



Answer 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 Article

Answer 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

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 Article

Answer 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 Article


Answer 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
Browsing all 6 articles
Browse latest View live




Latest Images