SQLTeam.com | Weblogs | Forums

Print multiline columns in the results of a sql query

USE [D:\DATA FILES 092015\DVD_LIST.MDF]
SELECT TITLE,RATED,PLOT
FROM [DVD_List]
ORDER BY TITLE
GO

In the above code the 'PLOT' item in the select command could be up to 500 characters in length. I need to print to a .pdf file and the PLOT column does not fit, How do I tell my query to output with multiline columns?

Do you mean multiple rows?

Or maybe just add line breaks in the column itself, depending on what the .pdf "expects" to see and how it reacts to it:

SELECT TITLE,RATED, LEFT(PLOT, 250) + CHAR(13) + CHAR(10) + 
    SUBSTRING(PLOT, 251, 250) AS PLOT
FROM [DVD_List]
ORDER BY TITLE