Answer: Suppose,we have a Test's value,which we have to insert on one column in a table,so if we write
INSERT INTO TEST1(NAME,ADDRESS) VALUES('TEST'S','ABC'D');
Then it will give error as
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'S'.
To overcome above problem,
We can escape the single quotes by
doubling or inserting two single quotes as shown in the below query as
INSERT INTO TEST1(NAME,ADDRESS) VALUES('TEST''S','ABC''D');
.
Asked In: Many Interviews |
Alert Moderator