Click here to Skip to main content
15,942,934 members
Please Sign up or sign in to vote.
1.60/5 (2 votes)
Hi guys,

i'm working hard to insert query with special characters in sql server 2008.

unfortunately i'm facing some errors.

for eg:
insert into measures values ('10'')

in the above query i'm trying to insert 10'(feet) but according to sql... it is treating it as wrong query/statement...

can any one plz help me, how to solve it.

Thanks
Posted

Attach one More Single Quote at Last..
Defiantly it will Execute Successfully.

SQL
insert into measures values ('10''')



Thanks
AARIF SHAIKH
 
Share this answer
 
Comments
King Fisher 11-Oct-14 5:23am    
well. i m unable to Post my ans. my 5+
Divyam Sharma 11-Oct-14 5:34am    
good one..
Try this :

SQL
create table  #tbl_test(name nvarchar(max))
INSERT INTO #tbl_test (name) VALUES ('10''')
select *from #tbl_test


Better you could Avoid To store data like this it may cause Sql Injection


http://www.unixwiz.net/techtips/sql-injection.html[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900