Miguel Moura
Miguel Moura

Reputation: 39524

Set table collation and make it case insensitive

I created a database using 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

How can I set, in this, the collation to latin and case insensitive?

Thank You, Miguel

Upvotes: 0

Views: 76

Answers (1)

PCG
PCG

Reputation: 1207

Just need to use the 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

Upvotes: 1

Related Questions