I use this statement in a stored Procedure:
...
DECLARE @VermText nvarchar(200)
...
SET @VermText = CHAR(13) + CHAR(10) + 'geändert am ' +
CONVERT(varchar(10), GETDATE(), 104) + ' wegen Abgabe'
...
And in the Update-Statement this:
txtVermerke = txtVermerke + @VermText
There are no Error Messages executing the procedure, but in the
Application instead of Char(13) and CHAR(10) I see two little squares
in the text.
What is wrong here?
Thank you in advance
Karl
Roy Harvey
Beacon Falls, CT
On Tue, 3 Jun 2008 06:36:47 -0700 (PDT), Karl Fuchs <fu...@ivsn.com>
wrote:
Your code works fine to insert a CR/LF. Try running your SET @VermText then
SELECT @VermText in the query window of your SQL query tool (SQL 2000 =
Query Analyzer, SQL 2005 = SQL Server Management Studio).
You will see that you are getting a CR/LF before the remaining text.
(However, you are putting non-Unicode data into the Unicode variable.
Ideally, you should always be working with Unicode. Not that it matters in
this data sample.)
So, why are you getting two little boxes? It is because your application
does not know how to interpret the CHAR(13) and CHAR(10). It is not doing a
CR/LF (is this in a grid control?) and it has no graphic to represent the
character, so the little box at least tells you something is there. You
need to examine your application tools to determine what you should do.
Of course, formatting of line breaks, etc. is usually the business of the
client application, not the SQL Server. So, you may need to think about
what you were trying to accomplish and determine if there is actually a
better way to define the problem.
RLF
"Karl Fuchs" <fu...@ivsn.com> wrote in message
news:b0467532-1a91-4cee...@z72g2000hsb.googlegroups.com...