Reputation: 15817
Say I have an INSERT
like this:
INSERT INTO Queries (query)
values ('select * from person
where id = 1
and idtype=2')
I then perform a SELECT
like this:
SELECT Query
FROM Queries
However, the result in SQL Server Management Studio is like this:
select * from person where id = 1 and idtype=2
I want a result like this:
select * from person
where id = 1
and idtype=2
How do I achieve this? SQL Server Management Studio seems to ignore carriage returns.
I recall reading a question on here some time ago which suggested using XML Path. The queries column is a varchar(100)
.
Upvotes: 1
Views: 729
Reputation: 2017
the carriage returns are there but they don't show in the grid results. try to copy and paste the results to a new query window or a text editor to check.
Upvotes: 0
Reputation: 1953
I use to insert texts in my columns with several carriage returns.
Do display this, try changing your query output as text instead of column. There should be a button in toolbox for that, but you can change it on Sql output options and preferences too.
Upvotes: 2