CREATE TABLE [dbo].[LogSoporteTmp](
	[Id] [int] NOT NULL,
	[IdCia] [char](2) NOT NULL,
	[Fecha] [smalldatetime] NOT NULL,
	[TipoProc] [varchar](10) NOT NULL,
	[GrupoNit] [bit] NOT NULL,
	[FecComp] [bit] NOT NULL,
	[Estado] [int] NOT NULL,
	[FechaCrea] [smalldatetime] NOT NULL,
	[IdUsuario] [varchar](11) NOT NULL,
	[Nombre] [varchar](50) NOT NULL,
	[Observacion] [varchar](500) NULL,
	[DescOpciones] [varchar](500) NULL)
	go

INSERT INTO LogSoporteTmp select * from LogSoporte
GO
DROP TABLE  LogSoporte
GO
CREATE TABLE [dbo].[LogSoporte](
	[Id] [int] NOT NULL,
	[IdCia] [char](2) NOT NULL,
	[Fecha] [smalldatetime] NOT NULL,
	[TipoProc] [varchar](10) NOT NULL,
	[GrupoNit] [bit] NOT NULL,
	[FecComp] [bit] NOT NULL,
	[Estado] [int] NOT NULL,
	[FechaCrea] [smalldatetime] NOT NULL,
	[IdUsuario] [varchar](11) NOT NULL,
	[Nombre] [varchar](50) NOT NULL,
	[Observacion] [varchar](500) NULL,
	[DescOpciones] [varchar](500) NULL,
 CONSTRAINT [PK_LogSoporte] PRIMARY KEY CLUSTERED 
(
	[Id] ASC,
	[IdCia] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[LogSoporte] ADD  DEFAULT ((0)) FOR [GrupoNit]
GO

ALTER TABLE [dbo].[LogSoporte] ADD  DEFAULT ((0)) FOR [FecComp]
GO

ALTER TABLE [dbo].[LogSoporte] ADD  DEFAULT ((0)) FOR [Estado]
GO

ALTER TABLE [dbo].[LogSoporte]  WITH CHECK ADD  CONSTRAINT [CK_LogSoporteIdCia] CHECK  ((len([IdCia])>(0)))
GO

ALTER TABLE [dbo].[LogSoporte] CHECK CONSTRAINT [CK_LogSoporteIdCia]
GO

ALTER TABLE [dbo].[LogSoporte]  WITH CHECK ADD  CONSTRAINT [CK_LogSoporteIdUsuario] CHECK  ((len([IdUsuario])>(0)))
GO

ALTER TABLE [dbo].[LogSoporte] CHECK CONSTRAINT [CK_LogSoporteIdUsuario]
GO

ALTER TABLE [dbo].[LogSoporte]  WITH CHECK ADD  CONSTRAINT [CK_LogSoporteNombre] CHECK  ((len([Nombre])>(0)))
GO

ALTER TABLE [dbo].[LogSoporte] CHECK CONSTRAINT [CK_LogSoporteNombre]
GO

ALTER TABLE [dbo].[LogSoporte]  WITH CHECK ADD  CONSTRAINT [CK_LogSoporteTipoProc] CHECK  ((len([TipoProc])>(0)))
GO

ALTER TABLE [dbo].[LogSoporte] CHECK CONSTRAINT [CK_LogSoporteTipoProc]
GO

INSERT INTO LogSoporte select * from LogSoporteTmp
GO
DROP TABLE  LogSoporteTmp




