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 |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-12-04 : 08:18:14
|
Cashrolls2 writes "How do you replace a single quote character i.e: ' with empty space with a string statement. when I tried the code below, i got the following error:Line 101: Incorrect syntax near ','.=========================================================SET @SQL = @SQL + ' REPLACE(LTRIM(LastName),''''','''') 'I am preparing a string statement to be executed later.Thanks" |
|
Kristen
Test
22859 Posts |
Posted - 2006-12-04 : 08:26:56
|
SET @SQL = @SQL + ' REPLACE(LTRIM(LastName),'''''''','''') 'Kristen |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-12-04 : 08:27:57
|
SET @SQL = @SQL + ' REPLACE(LTRIM(LastName), CHAR(39), '''''Peter LarssonHelsingborg, Sweden |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-12-04 : 09:22:13
|
quote: Originally posted by Peso SET @SQL = @SQL + ' REPLACE(LTRIM(LastName), CHAR(39), ''''')Peter LarssonHelsingborg, Sweden
MadhivananFailing to plan is Planning to fail |
 |
|
Kristen
Test
22859 Posts |
Posted - 2006-12-04 : 10:21:36
|
quote: Originally posted by madhivanan SET @SQL = @SQL + ' REPLACE(LTRIM(LastName), CHAR(39), '''')'Madhivanan
Probably needs to be SELECT rather than SET anyway ... but ... |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-12-04 : 10:27:26
|
Double Correction MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|