View previous topic :: View next topic
|
Author |
Message |
praveenedward_2009
New User
Joined: 26 Aug 2009 Posts: 21 Location: Chennai
|
|
|
|
Hi,
The below mentioned commands are for Sql server 2005.
Code: |
CREATE TABLE [dbo].[ADDRESS](
[ADDR-WHO] [varchar](18) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ADDRTYPE-WHO] [varchar](22) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ADDRESS1] [varchar](36) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
PRIMARY KEY CLUSTERED
(
[ADDR-WHO] ASC,
[ADDRTYPE-WHO] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] |
I need to create equivalanet statement in Db2 , i checked for the syntac for Primary Key clustered but not sure the equivalant of COLLATE SQL_Latin1_General_CP1_CI to be given in Db2.
Thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
COLLATE SQL_Latin1_General_CP1_CI - do all of your tables have this specification?
If yes, try leaving it out and see what happens. |
|
Back to top |
|
|
praveenedward_2009
New User
Joined: 26 Aug 2009 Posts: 21 Location: Chennai
|
|
|
|
Hi ,
Yes I do have " COLLATE SQL_Latin1_General_CP1_CI " in all of the tables , let me try out leaving it and creating those tables in Db2.
Thanks for the response will revert you back on the same. |
|
Back to top |
|
|
praveenedward_2009
New User
Joined: 26 Aug 2009 Posts: 21 Location: Chennai
|
|
|
|
I Did try out creating the tables need to check for the keyword " PRIMARY KEY CLUSTERED "
(
[ACCT-ID#] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
My answer - Primary key needs to be defined on Db2 on the field ( ACCT_ID ) .. CLUSTERED - Means whenever we create a primary key it creates a default unique index which will be clustered in this case becuase the primary key is the ideal column for a clustered index.
So we need to create a clustered index with the primary key on Db2. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Keep in mind that not every table needs to be clustered. . .
Suggest there be some review of the documentation and then discussion. At the top of the page is a link to "IBM Manuals" and there are several publications for multiple versions of db2. |
|
Back to top |
|
|
|