Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. if NOT exists (select * from dbo.sysobjects where name ='SER_SERVICIOS')
  2. BEGIN
  3.  
  4. PRINT 'Agregando Tabla: SER_SERVICIOS'
  5.  
  6.  
  7. CREATE TABLE [dbo].[SER_SERVICIOS](
  8. [TIPO_SERV] [char](1) NOT NULL,
  9. [COD_SERV] [tinyint] NOT NULL,
  10. [DESCRI] [char](50) NULL,
  11. [GENERACC] [bit] NULL,
  12. [GENERACAJA] [bit] NULL,
  13. [TIPCARCONS] [tinyint] NULL,
  14. [porcAcep] [numeric](6, 3) NULL,
  15. [cod_comp] [char](6) NULL,
  16. [cod_ctacon] [char](6) NULL,
  17. [bCuotaUnica] [bit] NULL,
  18. [bGrandesConsu] [bit] NULL,
  19. [lCobroBanco] [bit] NULL,
  20. CONSTRAINT [PK_SER_SERVICIOS] PRIMARY KEY NONCLUSTERED
  21. (
  22. [TIPO_SERV] ASC,
  23. [COD_SERV] ASC
  24. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
  25. ) ON [PRIMARY]
  26.  
  27. END
  28. GO
  29.  
  30. SET ANSI_PADDING OFF
  31. GO
  32.  
  33. IF NOT EXISTS(select * from dbo.syscolumns where ID = (select ID from dbo.sysobjects where name ='SER_SERVICIOS') AND name ='cod_comp' )
  34. begin
  35. PRINT 'Nueva Columna TABLA : SER_SERVICIOS - COLUMNA : cod_comp'
  36. ALTER TABLE dbo.SER_SERVICIOS ADD cod_comp char(6) NULL
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement