创建表格:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[StringsTest](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Value] [nvarchar](max) NOT NULL,
PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING ON
GO
插入数据(拉脱维亚语):
INSERT INTO [dbo].[StringsTest]
([Value])
VALUES
('TĀDS KĀDU JŪS')
GO
选择
SELECT * FROM [dbo].[StringsTest]
结果失去了重音:
Id Value
1 TADS KADU JUS
答案 0 :(得分:4)
在Unicode字符串之前使用N
来标记它。
INSERT [dbo].[StringsTest]
([Value])
VALUES
(N'TĀDS KĀDU JŪS')