IF NOT EXISTS (SELECT 1
               FROM   sys.objects
               WHERE  object_id = Object_id(N'DBO.TELE_ORC_ITEM_PBM'))
  BEGIN
      CREATE TABLE tele_orc_item_pbm
        (
           cd_emp                     INT NOT NULL,
           cd_filial                  INT NOT NULL,
           cd_orc                     INT NOT NULL,
           cd_it                      INT NOT NULL,
           id_terminal                VARCHAR(255) COLLATE sql_latin1_general_cp1_ci_as NULL,
           nsu_req                    VARCHAR(255) COLLATE sql_latin1_general_cp1_ci_as NULL,
           numero_sessao              VARCHAR(1000) COLLATE sql_latin1_general_cp1_ci_as NULL,
           cd_projeto_ext             MONEY NULL,
           cgc_cpf                    VARCHAR(255) COLLATE sql_latin1_general_cp1_ci_as NULL,
           perc_desc_unit_pbm         MONEY NULL,
           vlr_desc_unit_pbm          MONEY NULL,
           vlr_unit_pbm               MONEY NULL,
           flag_upload_receita_medica INT NULL,
           flag_exige_receita_medica  INT NULL,
           id_campanha                INT NULL,
           pre_autorizacao            VARCHAR(1000) COLLATE sql_latin1_general_cp1_ci_as NULL,
           numero_autorizacao         VARCHAR(1000) COLLATE sql_latin1_general_cp1_ci_as NULL,
           tipo_pbm                   INT NULL,
           cd_projeto                 INT NULL,
           nr_cartao_cli              VARCHAR(100) COLLATE sql_latin1_general_cp1_ci_as NULL,
           cnpj_projeto_pbm           VARCHAR(18) COLLATE sql_latin1_general_cp1_ci_as NULL,
           CONSTRAINT pk_tele_orc_item_pbm PRIMARY KEY (cd_orc, cd_it)
        );
  END; 