Paste into SQL Server table via Management Studio 2005 and keep line endings
-
22-09-2019 - |
Question
I cannot get this to work. I have opened a SQL Server Express table in SQL Server Management Studio 2005. When I try to paste a multiline text snippet into an NTEXT field it gets truncated to only include the first line.
In Access these kind of things works, what should i do?
Solution
Rewrite it as an UPDATE or INSERT INTO statement. String literals can span multiple lines:
declare @t table (d varchar(10))
insert into @t values ('a
b
c')
OTHER TIPS
We have had the same issue.
You can either use and insert statement
INSERT INTO TABLE (Col1,..., Coln)
SELECT Val1,...,
'MULTILINE
VALUE',...,Valn
Or use Access with linked tables to insert the values with multi lines.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow