Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 594
  • Last Modified:

Print nvarchar doe not print any output

I have a stored procedure which I want to debug
I have a few fields that are nvarchar(4000)

example @SqlString   nvarchar (4000)

This field is set to some text, when I do a print there is no output
PRINT @SqlString  

so when I do the follow exec sp_abc , i expected the print to output some information
If i add PRINT 'TEST' , i do see this being output
0
countrymeister
Asked:
countrymeister
1 Solution
 
cyberkiwiCommented:
If you are building up @sqlstring progressively, any time you add a NULL to it, the entire string becomes null and print null = no output.
0
 
countrymeisterAuthor Commented:
cyberkiwi, I added the following and I was able to see the data
SET CONCAT_NULL_YIELDS_NULL OFF

You are correct in your statement
0
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.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now