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 |
|
MrBean
Starting Member
14 Posts |
Posted - 2003-09-10 : 06:29:07
|
| Is it possible to insert a multi-line values into a text field thru a INSERT or UPDATE ?Normally I would use a bound value thru a ADO recordset but in this case I'm restricted to using SQL commands :( |
|
|
MrBean
Starting Member
14 Posts |
Posted - 2003-09-10 : 06:54:51
|
| Silly me... I found a solution :)insert into test values ('Line 1'+char(13)+char(10)+'Line 2'+char(13)+char(10)+'Line 3') |
 |
|
|
Amethystium
Aged Yak Warrior
701 Posts |
Posted - 2003-09-10 : 07:49:10
|
quote: Originally posted by MrBeaninsert into test values ('Line 1'+char(13)+char(10)+'Line 2'+char(13)+char(10)+'Line 3')
insert into test values ('Line 1'+SPACE(23)+'Line 2'+SPACE(23)+'Line 3')Sorry misread the question.------------------------------------------------------------------------------I enjoy using SQL Server but I am not part of the Microsoft fanboy club! NEVER!! |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-09-10 : 07:50:35
|
| Why the SPACE(23) ?? I believe the CR/LF between each line is probably what he wants.- Jeff |
 |
|
|
MrBean
Starting Member
14 Posts |
Posted - 2003-09-10 : 07:58:48
|
| Thanks for the attention, guys :)This may be a bit offtopic on a SQL Server forum, but is the CHAR function standard ANSI-SQL ?Does it also work on Oracle, MySQL and AS/400 ? |
 |
|
|
LarsG
Constraint Violating Yak Guru
284 Posts |
Posted - 2003-09-17 : 13:07:09
|
| Char is not an ANSI function. It works in Mysql though. Not in Oracle. AS/400 I don't know. |
 |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-09-17 : 13:11:28
|
| i believe it works for ODBC as well, so if you use that to connect it should be available regardless of what you connect to if the ODBC driver is fully implemented.I think it's called Chr() and not char(), though.- Jeff |
 |
|
|
|
|
|