Question mark in insert record

I have a SQL query that looks like this:

INSERT INTO DB..incident
( 
    incident_number        --nvarchar(10)
)
VALUES 
(
    N'I?'
)

      

What is he doing? in the instruction meanings?

EDIT :: Turns out some fun stuff with triggers and custom datatypes that come up on insertion (we have a slightly messed up DB.) With normal setup, I have marked the answer appropriately.

+1


source to share


2 answers


At the risk of sounding frivolous ... Nothing ... Does it set me up? in the field ... Try this ...



DECLARE @TestTable TABLE (test NVARCHAR(10))

INSERT INTO @TestTable (
    test
) VALUES ( 
    N'I?' ) 


SELECT * 
FROM  @TestTable

      

+6


source


The question is, in my opinion, when I was reading this, what does N do?

In Oracle, the N before the character string literal specifies that the string should be encoded in the national (that is, localized) character set, and not in the database's default character set.



As others have said, you insert the line "Me?" into the column. However, it can be encoded using a different character set (although, since these characters are in the standard ASCII range, the result is likely the same).

+1


source







All Articles