November 22, 2006 at 2:54 pm
It converts the following text to unicode.
November 22, 2006 at 2:54 pm
Having recently migrated from Access Databases to Access Projects and SQL Server, my self-training has been sporadic. I have been coming across syntax like
WHERE TABLE_NAME = N'vwProductSelect'
but I don't understand what the N is doing in front of the view name. Could someone please clear this up for me?
Thanks!
-- Al
November 22, 2006 at 2:57 pm
Thanks.
Is it normally necessary, or just good practice?
November 22, 2006 at 3:03 pm
Necessary only if your server uses unicode characters (like chinese). But for global applications like sql server or access, they have to assume that the data can be unicode, that way the application can handle any character on the planet.
November 23, 2006 at 12:01 am
In some cases it is necessary.
This will give you an error:
Exec sp_executesql 'Select @@ServerName'
This won't:
Exec
sp_executesql N'Select @@ServerName'
The error:
Msg 214, Level 16, State 2, Procedure sp_executesql, Line 1
Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply