Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use of N in commands
Message
De
09/03/2011 15:33:04
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Use of N in commands
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01503083
Message ID:
01503083
Vues:
87
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform