I cast it to XML
select @variable_with_long_text
as [processing-instruction(x)] FOR XML PATH
The processing-instruction
bit is there to stop it entitising characters such as <
to <
More Related Contents:
- I dont know sql syntax for my table [closed]
- Making a dynamic pivot table but without using the fiddle
- Get top 1 row of each group
- How to return only the Date from a SQL Server DateTime datatype
- How to cast the DateTime to Time
- Referring to a Column Alias in a WHERE Clause
- Convert Datetime column from UTC to local time in select statement
- How to implement LIMIT with SQL Server? [duplicate]
- Why is SQL Server losing a millisecond?
- converting Epoch timestamp to sql server(human readable format)
- Find a string by searching all tables in SQL Server
- What are Covering Indexes and Covered Queries in SQL Server?
- How do I split a delimited string so I can access individual items?
- Common Table Expression, why semicolon?
- Add a summary row with totals
- T-SQL split string based on delimiter
- Is there a performance difference between CTE , Sub-Query, Temporary Table or Table Variable?
- Why use Select Top 100 Percent?
- How do I find duplicates across multiple columns?
- Calculate business hours between two dates
- SQL Server UNION – What is the default ORDER BY Behaviour
- How to get last 7 days data from current datetime to last 7 days in sql server
- How to check which locks are held on a table
- store arabic in SQL database
- What is the Null Character literal in TSQL?
- SQL Server : SUM() of multiple rows including where clauses
- SQL Script to alter ALL Foreign Keys to add ON DELETE CASCADE
- SQL Server search using like while ignoring blank spaces
- Find last sunday
- How to concatenate all columns in a select with SQL Server