Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use of N in commands
Message
From
09/03/2011 15:33:04
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Use of N in commands
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01503083
Message ID:
01503083
Views:
89
I have always use the N character when defining a command. I probably got that one from an earlier example. But, using it or not seems to work:
DECLARE @Command nvarchar(4000)

SET @Command = 'ALTER TABLE [Server] ADD [MyField] numeric(15,0)'
EXEC sp_executesql @Command
DECLARE @Command nvarchar(4000)

SET @Command = N'ALTER TABLE [Server] ADD [MyField] numeric(15,0)'
EXEC sp_executesql @Command
Is there any difference in using it or not? Or, basically, what is it used for?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform