Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Sep410
Posting Yak Master
117 Posts |
Posted - 2008-08-20 : 18:26:10
|
| Hi,Here is my problem:INSERT INTO [CFS].[dbo].[tbl_Comment] ([CaseID] ,[Comment] ,[ComDate] ,[AutoComment]) VALUES ('46',' FM Group: Changed to Nobody's Perfect *** ','8/20/2008 4:11:00 PM','True')Comment fields originaly contains "'" What can I do?Comment will change evry time by user.Please help me.Sep |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Sep410
Posting Yak Master
117 Posts |
Posted - 2008-08-20 : 18:48:22
|
| the problem is I don't know when the comment has ' in it.Sep |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-08-20 : 18:57:11
|
| If the answer to my above question is application code, then you need to handle this in there by using parameterized queries rather. You not only avoid this issue but also SQL injection.Read this for more information:http://it.toolbox.com/wiki/index.php/How_do_I_escape_single_quotes_in_SQL_queries%3FTara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
|
|
|
|