Last post Jun 05, 2016 01:21 PM by Das.Sandeep
Jun 04, 2016 08:49 AM|Moodhi|LINK
When exporting SQL server 2008 R2 database using MSSM Studio feature - Tasks, Generate Scripts and selecting "Type of data to script" as "schema and data", the output script contains a funny "N'" characters, what is it? please see below
/****** Object: Database [LeafletDist] Script Date: 06/04/2016 09:46:22 ******/
CREATE DATABASE [LeafletDist] ON PRIMARY
( NAME = N'LeafletDistribution', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\LeafletDist.mdf' , SIZE = 75776KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
( NAME = N'LeafletDistribution_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\LeafletDist_1.ldf' , SIZE = 353216KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
SET IDENTITY_INSERT [dbo].[tblSupplier] ON
INSERT [dbo].[tblSupplier] ([ID], [Code], [Name], [Address], [ContactNo], [LastDelivery]) VALUES (1, N's1001 ', N'Mahmud', N'21 Penn Drive, Denham', N'01895 832 686', CAST(0x0000A44A00000000 AS DateTime))
INSERT [dbo].[tblSupplier] ([ID], [Code], [Name], [Address], [ContactNo], [LastDelivery]) VALUES (4, N's1002 ', N'Baber', N'27 Beechwood Avenue, Hillingdon', N'01895 4222 96', CAST(0x0000A44B00000000 AS DateTime))
Does anyone know what this "N'" is everywhere ?
Jun 04, 2016 10:49 AM|das.sandeep|LINK
'N' denotes that in your file, Unicode character exists (the N actually stands for National language character set). Which shows that you are passing NCHAR, NVARCHAR or NTEXT value.
Jun 04, 2016 11:31 PM|Moodhi|LINK
Thanks but the question I was meant to ask is how do I stop it from exporting this char? because when I try and run the same script it fails as it does not like 'N' character appearing everywhere.
Jun 05, 2016 01:21 PM|das.sandeep|LINK
In this case you have to use VARCHAR, CHAR and TEXT need to use as database table column type.