none
DROP COLUMN SCRIPT IS NOT GENERATE RRS feed

  • Pergunta

  • Hi,

    I did a compare schema and the result show that a column will be drop in the target database, but when a export to editor the script to drop column doesn't generate.

    For exemple:

    Source Object:

    CREATE TABLE [dbo].[Leito] (
        [lei_codigo]        CHAR (4)     NOT NULL,
        [locatend_codigo]   CHAR (4)     NOT NULL,
        [lei_status]        CHAR (1)     NULL,
        [lei_motivo]        TEXT         NULL,
        [lei_tipo]          CHAR (1)     NULL,
        [lei_descricao]     VARCHAR (30) NULL,
        [lei_extra]         CHAR (1)     NULL,
        [lei_tipo_uti]      CHAR (1)     NULL,
        [TIPESPLEI_CODIGO]  CHAR (4)     NULL,
        [LEI_REGULAVEL]     CHAR (1)     NULL,
        [Codigo_integracao] VARCHAR (10) NULL
    );

    Target Object: (The column Lei_censo will be drop)

    CREATE TABLE [dbo].[Leito] (
        [lei_codigo]        CHAR (4)     NOT NULL,
        [locatend_codigo]   CHAR (4)     NOT NULL,
        [lei_status]        CHAR (1)     NULL,
        [lei_motivo]        TEXT         NULL,
        [lei_tipo]          CHAR (1)     NULL,
        [lei_censo]         CHAR (1)     NULL,
        [lei_descricao]     VARCHAR (30) NULL,
        [lei_extra]         CHAR (1)     NULL,
        [lei_tipo_uti]      CHAR (1)     NULL,
        [TIPESPLEI_CODIGO]  CHAR (4)     NULL,
        [LEI_REGULAVEL]     CHAR (1)     NULL,
        [Codigo_integracao] VARCHAR (10) NULL
    );

    Generated script

    GO
    IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
    GO
    IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
    GO
    PRINT N'Altering dbo.Leito...';


    GO

    [HERE IS THE PROBLEM]

    GO
    IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION

    I changed a lot of options but the problem persist.

    Thanks


    Mussi
    sexta-feira, 26 de março de 2010 02:26

Todas as Respostas

  • Hello Leandro,

    Which version of VSTS are you using?

    Doesn't the button "write updates" solve your problem, syncing the source and target?

    I tried to reproduce the error in VS 2010, but I didn't get it.

    Please, let us know if your problem persists.

    []'s


    Ricardo Serradas
    Team System in a nutshell - http://blog.ricardoserradas.net
    sábado, 27 de março de 2010 19:45
  • Hi Ricardo,

    I´m using VS 2008 GRD2.

    []'s

     


    Mussi
    segunda-feira, 29 de março de 2010 17:25
  • Check in the error list if there are any erros that may be preventing you from doing the export.


    Ricardo Serradas
    Team System in a nutshell - http://blog.ricardoserradas.net
    quinta-feira, 1 de abril de 2010 01:19
  • Check in the error list if there are any erros that may be preventing you from doing the export.


    Ricardo Serradas
    Team System in a nutshell - http://blog.ricardoserradas.net
    quinta-feira, 1 de abril de 2010 01:19