Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15694

Escaping single quotes and comma in an insert statment.

$
0
0

Hello Everyone,

I have an sql query like below:
INSERT INTO tbl(col1,col2,col3) VALUES('abc','1','2','3','def')

Here col2 should have the value: '1','2','3'.

But on executing the query i get an error as "Column name or number of supplied values does not match table definition." I get the point why I am getting the error, but is there a way to resolve it?
Please Help!!

Thanks in advance.
Brizika


Viewing all articles
Browse latest Browse all 15694

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>