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 |
|
RobVG
Starting Member
42 Posts |
Posted - 2003-07-11 : 13:34:00
|
| How do you insert a string containing an " 's " w/o getting an unclosed quote error? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-07-11 : 13:45:25
|
| CREATE TABLE Table1(Column1 VARCHAR(100) NOT NULL)INSERT INTO Table1 VALUES('You''re cool.')SELECT * FROM Table1DROP TABLE Table1-------[EDIT]Those are single quotes above.[/EDIT]TaraEdited by - tduggan on 07/11/2003 13:47:08 |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-07-11 : 13:54:38
|
| And if you start to build some complicated strings, I like to keep the ticks separated by themselves, just so you don't drive yourself crazy...so I know that 4 ticks = 1 in the string. Like:SELECT ''''+ 'A' + ''''Which is the same as:SELECT '''A'''Brett8-)Edited by - x002548 on 07/11/2003 13:55:41 |
 |
|
|
RobVG
Starting Member
42 Posts |
Posted - 2003-07-11 : 14:35:39
|
Thanks People!(It looks funny-but it works ) |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2003-07-11 : 14:45:45
|
| Rob-Read up on QUOTENAME() in BOL.Jonathan{0} |
 |
|
|
RobVG
Starting Member
42 Posts |
Posted - 2003-07-12 : 00:53:19
|
| -JonathanOk, I give up... what does BOL mean?I might as well reiterate... brand-spanking-Newbie.Edited by - RobVG on 07/12/2003 01:14:04 |
 |
|
|
Amethystium
Aged Yak Warrior
701 Posts |
Posted - 2003-07-12 : 16:19:21
|
| Books On Line...and if you search for QUOTEIDENTIFIER you will find it useful when inserting complex strings.---------------Shadow to LightEdited by - Amethystium on 07/12/2003 16:21:41 |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-07-14 : 10:07:22
|
quote: Books On Line...and if you search for QUOTEIDENTIFIER you will find it useful when inserting complex strings.---------------Shadow to LightEdited by - Amethystium on 07/12/2003 16:21:41
Huh?How?Brett8-) |
 |
|
|
|
|
|