Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Create Table Statement. What does this mean?

Author  Topic 

DavidChel
Constraint Violating Yak Guru

474 Posts

Posted - 2009-01-15 : 10:55:11
So, I ran a create table script and got the following:

/****** Object: Table [dbo].[SOITEM_EXT]   Script Date: 1/15/2009 9:51:49 AM ******/
USE [M2MDATA01];
GO
SET ANSI_NULLS ON;
GO
SET QUOTED_IDENTIFIER ON;
GO
CREATE TABLE [dbo].[SOITEM_EXT] (
[Identity_Column] int IDENTITY(1, 1) NOT NULL,
[Timestamp_Column] timestamp NULL,
[FKey_ID] int NOT NULL,
[FCPOLINE] char(7) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FCUKQTENO] char(20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FMDELIV] text COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT [PK_SOITEM_EXT]
PRIMARY KEY CLUSTERED ([FKey_ID] ASC)
WITH FILLFACTOR = 100
ON [PRIMARY]
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY];
GO

/****** Object: Index [dbo].[identity_column_idx1] Script Date: 1/15/2009 9:51:51 AM ******/
CREATE UNIQUE NONCLUSTERED INDEX [identity_column_idx1]
ON [dbo].[SOITEM_EXT]
([Identity_Column])
WITH
FILLFACTOR = 100
ON [PRIMARY];
GO


What exactly does this stuff mean?

COLLATE SQL_Latin1_General_CP1_CI_AS
COLLATE SQL_Latin1_General_CP1_CI_AS
etc.

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-01-15 : 11:01:32
quote:
Originally posted by DavidChel

So, I ran a create table script and got the following:

/****** Object: Table [dbo].[SOITEM_EXT]   Script Date: 1/15/2009 9:51:49 AM ******/
USE [M2MDATA01];
GO
SET ANSI_NULLS ON;
GO
SET QUOTED_IDENTIFIER ON;
GO
CREATE TABLE [dbo].[SOITEM_EXT] (
[Identity_Column] int IDENTITY(1, 1) NOT NULL,
[Timestamp_Column] timestamp NULL,
[FKey_ID] int NOT NULL,
[FCPOLINE] char(7) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FCUKQTENO] char(20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FMDELIV] text COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT [PK_SOITEM_EXT]
PRIMARY KEY CLUSTERED ([FKey_ID] ASC)
WITH FILLFACTOR = 100
ON [PRIMARY]
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY];
GO

/****** Object: Index [dbo].[identity_column_idx1] Script Date: 1/15/2009 9:51:51 AM ******/
CREATE UNIQUE NONCLUSTERED INDEX [identity_column_idx1]
ON [dbo].[SOITEM_EXT]
([Identity_Column])
WITH
FILLFACTOR = 100
ON [PRIMARY];
GO


What exactly does this stuff mean?

COLLATE SQL_Latin1_General_CP1_CI_AS
COLLATE SQL_Latin1_General_CP1_CI_AS
etc.



That means collation of your columns.
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-01-15 : 11:53:38
FROM BOL
Collations specify the rules for how strings of character data are sorted and compared, based on the norms of particular languages and locales. For example, in an ORDER BY clause, an English speaker would expect the character string 'Chiapas' to come before 'Colima' in ascending order. But a Spanish speaker in Mexico might expect words beginning with 'Ch' to appear at the end of a list of words starting with 'C'. Collations dictate these kinds of sorting and comparison rules. The Latin_1 General collation will sort 'Chiapas' before 'Colima' in an ORDER BY ASC clause, while the Traditional_Spanish collation will sort 'Chiapas' after 'Colima'.
Also look at the COLLATE clause for more info

Jim
Go to Top of Page

DavidChel
Constraint Violating Yak Guru

474 Posts

Posted - 2009-01-15 : 12:10:49
Cool. Thanks Jim.
Go to Top of Page
   

- Advertisement -