1

When we write a query in sql for taking backup on a perticular location then we have to use query like this

BACKUP DATABASE [SQLAuthority]
TO DISK = N'D:\SQLAuthority.bak'

I want to know that what is the actual mean of 'N' (after = sign) here.

One more thing If I dont use the 'N' then backup will be done or not.

Can any one explain this

Ghost Answer
  • 1,458
  • 1
  • 17
  • 41

1 Answers1

5

It specifies that the string is nvarchar data type instead of varchar

You may have seen Transact-SQL code that passes strings around using an N prefix. This denotes that the subsequent string is in Unicode (the N actually stands for National language character set). Which means that you are passing an NCHAR, NVARCHAR or NTEXT value, as opposed to CHAR, VARCHAR or TEXT. See Article #2354 for a comparison of these data types.

Reference: http://databases.aspfaq.com/general/why-do-some-sql-strings-have-an-n-prefix.html

Satpal
  • 132,252
  • 13
  • 159
  • 168