Solved

Print nvarchar doe not print any output

Posted on 2010-08-20
2
586 Views
Last Modified: 2012-05-10
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
Comment
Question by:countrymeister
2 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 250 total points
ID: 33489745
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
 
LVL 1

Author Comment

by:countrymeister
ID: 33489845
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

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now