A***s 发帖数: 389 | 1 "UPDATE patient SET name = STUFF(name,CHARINDEX("'",name),1,"`") WHERE
CHARINDEX("'",name) <> 0"
就是找出name这项中的单引号换成反单引号,但这个单引号怎么也价不进去,我该怎么办
啊?谢谢 | j*****o 发帖数: 320 | 2 是不是要\'丫。
【在 A***s 的大作中提到】 : "UPDATE patient SET name = STUFF(name,CHARINDEX("'",name),1,"`") WHERE : CHARINDEX("'",name) <> 0" : 就是找出name这项中的单引号换成反单引号,但这个单引号怎么也价不进去,我该怎么办 : 啊?谢谢
| A***s 发帖数: 389 | 3 大哥,那是C
么办
【在 j*****o 的大作中提到】 : 是不是要\'丫。
| v**m 发帖数: 242 | 4 try this one:
UPDATE member SET email = STUFF(email,CHARINDEX('''',email),1,char(96))WHERE
CHARINDEX('''',email) <> 0
办
【在 A***s 的大作中提到】 : "UPDATE patient SET name = STUFF(name,CHARINDEX("'",name),1,"`") WHERE : CHARINDEX("'",name) <> 0" : 就是找出name这项中的单引号换成反单引号,但这个单引号怎么也价不进去,我该怎么办 : 啊?谢谢
| A***s 发帖数: 389 | 5 thx,just got the solution:
UPDATE member SET email = STUFF(email,CHARINDEX(char(39),email),1,'`')WHERE
CHARINDEX(char(39),email) <> 0
么
【在 v**m 的大作中提到】 : try this one: : UPDATE member SET email = STUFF(email,CHARINDEX('''',email),1,char(96))WHERE : CHARINDEX('''',email) <> 0 : : 办
| v**m 发帖数: 242 | 6 I am glad things work out finally. There are a few question, just curious.
First, how did u add the single quote to the database? I guess it should be
two single quote, that's why you need use char(39) to get it. Second, how can
you put '`' there? copy & paste? I would suggest you use char(96) or correct
char() number.
STUFF(email,CHARINDEX('''',email),1,char(96))WHERE
怎
【在 A***s 的大作中提到】 : thx,just got the solution: : UPDATE member SET email = STUFF(email,CHARINDEX(char(39),email),1,'`')WHERE : CHARINDEX(char(39),email) <> 0 : : 么
| p*****e 发帖数: 58 | 7 In SQL the character ' is used as escape character (plays the same role as \
in C) and quotation mark (similar to " in VB). So all ' in a string should be
replaced by ''.
Example 1: select all the tableName records where companyName is "Sam's Food":
Select * from tableName where companyName = 'Sam''s food'
Example 2: select all recordes where companyName containing ':
Select * from tableName where companyName like '%''%'
can
STUFF(email,CHARINDEX(char(39),email),1,'`')WHERE
该
【在 v**m 的大作中提到】 : I am glad things work out finally. There are a few question, just curious. : First, how did u add the single quote to the database? I guess it should be : two single quote, that's why you need use char(39) to get it. Second, how can : you put '`' there? copy & paste? I would suggest you use char(96) or correct : char() number. : : STUFF(email,CHARINDEX('''',email),1,char(96))WHERE : 怎
|
|