数据库存储上下标符号,sqlserver 2008r2,dm8
sqlserver 2008r2:
- 数据类型需要用nvarchar
- 插入数据时字符串前需要用N
create table test(
col1 varchar(50),
col2 nvarchar(50)
)
insert into test(col1,col2) values('U¹²³⁴⁵⁶⁷⁸⁹⁰D₁₂₃₄₅₆₇₈₉₀','U¹²³⁴⁵⁶⁷⁸⁹⁰D₁₂₃₄₅₆₇₈₉₀')
insert into test(col1,col2) values(N'U¹²³⁴⁵⁶⁷⁸⁹⁰D₁₂₃₄₅₆₇₈₉₀',N'U¹²³⁴⁵⁶⁷⁸⁹⁰D₁₂₃₄₅₆₇₈₉₀')
select * from test
dm8:
- 数据类型用nvarchar、varchar 都可以
- 插入数据时字符串前用N、不用N 都可以
create table test(
col1 varchar(100),
col2 nvarchar(100)
);
insert into test(col1,col2) values('U¹²³U⁴⁵⁶⁷⁸⁹⁰D₁₂₃₄₅₆₇₈₉₀','U¹²³U⁴⁵⁶⁷⁸⁹⁰D₁₂₃₄₅₆₇₈₉₀');
insert into test(col1,col2) values(N'U¹²³U⁴⁵⁶⁷⁸⁹⁰D₁₂₃₄₅₆₇₈₉₀',N'U¹²³U⁴⁵⁶⁷⁸⁹⁰D₁₂₃₄₅₆₇₈₉₀');
COMMIT;
select * from test;