All objects inside the database. I just learned this few weeks ago when a problem was consulted to me. I initially thought that values are affected and was surprised it is not the case.
So let's prove it; create a database - zCollationCI (case-insensitive) and zCollationCS (case-sensitive).
USE MASTERCreate a table for each database and perform the two (2) "SELECT" statements. You'll see the difference.
GO
CREATE DATABASE [zCollationCI] ON ( NAME = Sales_dat,
FILENAME = 'D:\MSSQLDB\zCollationci.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )LOG ON ( NAME = 'Sales_log',
FILENAME = 'D:\MSSQLDB\zCollationci_log.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB )COLLATE SQL_Latin1_General_CP1_CI_AS
GO
CREATE DATABASE [zCollationCS] ON ( NAME = Sales_dat,
FILENAME = 'D:\MSSQLDB\zCollationcs.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )LOG ON ( NAME = 'Sales_log',
FILENAME = 'D:\MSSQLDB\zCollationcs_log.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB ) COLLATE SQL_Latin1_General_Cp1_CS_AS
GO
USE [zCollationCI]
CREATE TABLE [dbo].[testTable1](
[testCol01] [nchar](10) NULL,
[testCol02] [nchar](10)
)-- lowercaseSELECT testcol01, testcol02 FROM testtable1;-- following objects' case
SELECT testCol02, testCol02 FROM testTable1;
USE [zCollationCS]
CREATE TABLE [dbo].[testTable1](
[testCol01] [nchar](10) NULL,
[testCol02] [nchar](10)
)
-- lowercaseSELECT testcol01, testcol02 FROM testtable1;
-- following objects' caseSELECT testCol02, testCol02 FROM testTable1; I also found similar this blog which gives another example.I want some Moore - Blog about stuff and things and stuff. Mostly about SQL server and .NetLet me know if you find error(s) in my post, technical and grammatical so that i can correct it. Please don't be harsh. I'm n00b.
..
No comments:
Post a Comment