设置表格排序并使其不区分大小写

时间:2013-12-12 17:12:43

标签: sql sql-server

我使用T-SQL创建了一个数据库:

create database MyDb
on primary ( 
  name = 'MyDb_Data',
  size = 40MB,
)
,
filegroup [FILES] contains filestream ( 
  name = 'MyDb_Files'
)
log on ( 
  name = 'MyDb_Log',
  size = 4MB
);
go

如何在此设置对拉丁语和不区分大小写的排序规则?

谢谢你, 米格尔

1 个答案:

答案 0 :(得分:1)

只需要使用COLLATE

CREATE DATABASE [asdf]
CONTAINMENT = NONE
ON  PRIMARY 
( NAME = N'asdf', FILENAME = N'D:\SQLData\asdf.mdf' , SIZE = 4096KB , FILEGROWTH = 1024KB )
LOG ON 
( NAME = N'asdf_log', FILENAME = N'D:\SQLData\asdf_log.ldf' , SIZE = 1024KB , FILEGROWTH = 10%)
COLLATE Latin1_General_CI_AS
GO