Column names must be unique?

BasharLuluBasharLulu Posts: 9
edited April 27, 2006 12:40PM in SQL Packager Previous Versions
Hi!

When trying to use SQL Packager to synchronize two databases using an EXE I get the following wierd error message;

'Column names in each table must be unique.
Column name 'Category' in 'dbo.tblConfig' is specified more than once.'

I tried to remove this table from the synchronization package but I still get the same error.

What to do? Thanks in advance.

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hello,

    You could be attempting to run an 'upgrade' package on a database other than one of the databases on which the package had been generated. This is one way I can think of when a package would attempt to add a column that already exists.
  • Thanks Brian,

    This is indeed the case here. Is there some sort of workaround for this? I know this sounds stupid, but we sometimes have to resort to such tactics.

    Furthermore, why can't I remove this table from the synchronization package. I've unchecked the checkbox next to it but nothing happens.

    Thanks,
    Bashar Lulu
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    There isn't anything you can do, really, Packages are not dynamic and can't cope with changes in the database they're being run against. Rather, they are just SQL scripts that are rolled into a self-running executable.

    If you cannot get rid of the table, chances are it's automatically included as part of a dependency, In other words, if you do not include the table a change to a view or stored procedure may then fail.
  • Hey Brian,

    I created another SQL package. This time I'm updating the database with which I created the original comparison. The same error ooccurs.

    Other errors occur, but I'd like to resolve this one first.

    Thanks,
    Bashar Lulu, MVP
    Information Systems Analyst
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Can you post up the SQL script for this table?
  • Hey Brian,

    I apologize for the delay in my reply. Please find enclosed the script for the table 'tblConfig' which is causing the first of my many errors;

    [code]/****** Object: Table [dbo].[tblConfig] Script Date: 25/04/2006 01:40:39 PM ******/
    CREATE TABLE [dbo].[tblConfig] (
    [TrxNo] [int] NOT NULL ,
    [Value] [nvarchar] (200) COLLATE Arabic_CI_AS NULL ,
    [ADescription] [nvarchar] (200) COLLATE Arabic_CI_AS NULL ,
    [EDescription] [nvarchar] (200) COLLATE Arabic_CI_AS NULL ,
    [Chk] [int] NULL ,
    [category] [int] NULL
    ) ON [PRIMARY]
    GO

    ALTER TABLE [dbo].[tblConfig] WITH NOCHECK ADD
    CONSTRAINT [PK_tblConfig] PRIMARY KEY CLUSTERED
    (
    [TrxNo]
    ) ON [PRIMARY]
    GO

    ALTER TABLE [dbo].[tblConfig] ADD
    CONSTRAINT [DF_tblConfig_category] DEFAULT (0) FOR [category]
    GO

    CREATE INDEX [IDX_tblConfig_category] ON [dbo].[tblConfig]([category]) ON [PRIMARY]
    GO

    CREATE INDEX [IX_tblConfig_category] ON [dbo].[tblConfig]([category]) ON [PRIMARY]
    GO

    ALTER TABLE [dbo].[tblConfig] ADD
    CONSTRAINT [FK_tblConfig_ConfigCategory] FOREIGN KEY
    (
    [category]
    ) REFERENCES [dbo].[ConfigCategory] (
    [code]
    ) ON UPDATE CASCADE
    GO[/code]

    Thanks.
    Bashar Lulu
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hello,

    In the database that you're going to upgrade, is the collation order the same (Arabic_CI_AS)?
  • Hi,

    Yes it is.

    Bashar Lulu
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    ...and in the summary of actions that you see when you create the package, you see something like add column 'Category'?
Sign In or Register to comment.