what does the "n'dbname" what does the 'n' stand for and
12,010
"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. "
Related videos on Youtube
Author by
Neo
Updated on September 17, 2022Comments
-
Neo over 1 year
USE [master] GO /****** Object: Database [assist] Script Date: 11/13/2010 20:17:49 ******/ CREATE DATABASE [assist] ON PRIMARY ( NAME = N'assist', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.THIRD\MSSQL\DATA\assist.mdf' , SIZE = 2304KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON ( NAME = N'assist_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.THIRD\MSSQL\DATA\assist_log.LDF' , SIZE = 504KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
In the above, what do the following terms mean/usage.
GO
?N' within this statement "NAME = N'assist', FILENAME = N'C:\Program Files"
-
Neo over 13 yearsand the remaining "go"?
-
EngineeringSQL over 13 yearsThe keyword GO tells SQL Server to execute the preceding code as one batch. Also, check out mssqltips.com/tip.asp?tip=1216 which explains the ability to add a number after the GO keyword to tell SQL Server (2005+) how many times to execute the batch.