How can I force new lines in an nvarchar field whose content I am constructing in a stored procedure?

I am building an application that will dynamically construct stored procedures from relatively non-technical users' inputs. One of several aspects of this is to build the parameter list for the Create Procedure code. The problem I  have encountered is that while the code below appears to function correctly, when the result is selected, the new line pair of characters are apparently replaced automatically with spaces.

Any suggestions gratefully received!

/* Problem trying to force new lines in an output nvarchar field  */
Declare @T table(DisplaySeq int, ParamName nvarchar(128), ParamDataType nvarchar(50))
Declare @NumParams int,  @ParamList nvarchar(1000),  @ThisParam nvarchar(100),  @NewLine nvarchar(10),  @ThisSeq int
-- Test data to demonstrate the problem
      Insert into @T (DisplaySeq, ParamName, ParamDataType) Values (1, '@WorkOrder#','nvarchar(10)')
      Insert into @T (DisplaySeq, ParamName, ParamDataType) Values (2, '@FromDateSampled','date')
      Insert into @T (DisplaySeq, ParamName, ParamDataType) Values (3, '@ToDateSampled','date')
      Insert into @T (DisplaySeq, ParamName, ParamDataType) Values (4, 'CustomerState','nvarchar(2)')
-- Get ready to build the parameter list
Set @NewLine = CHAR(13) + CHAR(10)
Set @ParamList = ''
Set @NumParams = (Select COUNT(*) from @T)
Set @ThisSeq = 1
-- Build the parameter list
While @ThisSeq <= @NumParams
      begin
            Set @ThisParam = (Select ParamName + ' ' + ParamDataType From @T Where (DisplaySeq = @ThisSeq))
            If @ThisSeq = 1 begin
                  Set @ParamList = @ParamList + @ThisParam
            end
            else begin
                  Set @ParamList = @ParamList + @NewLine + ', ' + @ThisParam
            end
            Set @ThisSeq = @ThisSeq + 1
      end
-- Show the result. Looks like CHAR(13) and CHAR(10) have been replaced with spaces
Select @ParamList as ResultingList
ParamList-result.PNG
Douglass MacLeanCTOAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Deepak ChauhanSQL Server DBACommented:
Parmeters are displaying in new line. You can check with print statement or press CTRL+T before executing the code.

ResultingList
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@WorkOrder# nvarchar(10)
, @FromDateSampled date
, @ToDateSampled date
, CustomerState nvarchar(2)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Douglass MacLeanCTOAuthor Commented:
Thanks, Deepak!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.