Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8835559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:17:14+00:00 2026-06-14T09:17:14+00:00

As part of a migration project, we have imported data from a JDE iSeries

  • 0

As part of a migration project, we have imported data from a JDE iSeries DB2 database. An SSIS package was created to create the destination tables and import data. The import went successfully.

Now comes the problem – The customer wants Primary Keys created in the destination DB (SQL 2008 R2). The problem table in this case, would be one table that has 104 columns and 7.5 million rows of data. The PK required for this table is composite and has 7 columns.

We are considering this :

BEGIN TRANSACTION
GO
    ALTER TABLE [dbo].[F0911] ADD  CONSTRAINT [F0911_PK] PRIMARY KEY CLUSTERED 
    (
        [GLDCT] ASC,
        [GLDOC] ASC,
        [GLKCO] ASC,
        [GLDGJ] ASC,
        [GLJELN] ASC,
        [GLLT] ASC,
        [GLEXTL] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    GO
COMMIT

or this:

-- Rename existing tables
        sp_RENAME '[F0911]' , '[F0911_old]'
        GO

    -- Create new table
        SELECT * INTO F0911 FROM F0911_old WHERE 1=0
        GO

    --Create PK constraints
        ALTER TABLE [dbo].[F0911] ADD  CONSTRAINT [F0911_PK] PRIMARY KEY CLUSTERED 
        (
            [GLDCT] ASC,
            [GLDOC] ASC,
            [GLKCO] ASC,
            [GLDGJ] ASC,
            [GLJELN] ASC,
            [GLLT] ASC,
            [GLEXTL] ASC
        )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
        GO

    --Insert data into new tables
        INSERT INTO F0911
        SELECT * FROM F0911_old
        GO

    -- Drop old tables
        DROP TABLE F0911_old
        GO

Which would be a more efficient approach, performance wise? I have a gut feeling that both are the same and even the first approach does the same thing as the second one does, implicitly. Is this understanding correct?

Please note that all these columns already exist in the table and we cannot modify the table definition.

Thanks,
Raj

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:17:15+00:00Added an answer on June 14, 2026 at 9:17 am

    They’re the same. The effect of creating a clustered index is to arrange the pages which will happen in both cases. For non-clustered indexes it will help to disable the index and then turn it back on and rebuilding it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As part of our intended migration from Linq2Sql to Entity Framework, we have created
As part of our migration from VS 2010 to VS 2012 we have begun
I'm currently working on a migration project, to migrate data from the old db
I have a test server that uses data from a test database. When I'm
Finally reached data migration part of my Project and now trying to move data
As part of our migration from .net 1.1 to .net 3.5, we had to
I have redesigned my Firebird based SQL database. As part of this process I
I am working on migration of data from an old system to a new
As part of a content migration project, I am building content into a CMS
As part of a project I'm working on, we're migrating from Velocity to JSP.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.