Problema Extraño con UPDATE !

19/01/2005 - 00:31 por Romero Diego | Informe spam
Hola
Amigos del grupo
Me esta sucediendo algo estraño con la siguiente instrucción UPDATE :

UPDATE VEHICULOS SET
VEH_MOD='1999',VEH_COL='003',VEH_EJE='2',VEH_CAT='',VEH_CAP='',VEH_PES='35',
VEH_REP='',VEH_CAR='001',VEH_MAT='',VEH_COT='',VEH_TMO='',VEH_TAR=''
,VEH_CIV='54412125',VEH_NSO='554451212',VEH_NTO='',VEH_REG='2151212',VEH_FOT
='',VEH_LTR='',VEH_AND='',VEH_VCI='20051130',VEH_VSO='20051130'
,VEH_VTO='20050520',VEH_VRE='20051130',VEH_VAL=0,VEH_ASE=0,VEH_CON='12300300
',VEH_ESO='9263799',VEH_EMP='',VEH_LIN='CH009',VEH_MAR='CH'
,VEH_TIP='001',VEH_MOT='74555A54411',VEH_CHA='22415121225',VEH_TRA='',VEH_BL
O=0,VEH_PRO='145500500',VEH_POS='145500500',VEH_TEN='001' WHERE
VEH_PLA='JLA802'

El problema es que al modificar el valor de la columna VEH_BLO=0 se
actualiza tambien la columna VEH_VPR a 0, la cual NO va en la instrucción
porque no se permite actualizar.
Lo estraño es que si quito de la instrucción VEH_BLO=0 la columna VEH_VPR
mantiene su valor
¿ por que ?

Ambas columnas son tipo BIT ¿Tiene que ver eso ?

Le envio el script de la tabla , la cual no tiene relaciones, ni trigger, ni
check , nada especial


if exists (select * from dbo.sysobjects where id object_id(N'[dbo].[VEHICULOS]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[VEHICULOS]
GO

CREATE TABLE [dbo].[VEHICULOS] (
[VEH_PLA] [varchar] (10) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_MAR] [varchar] (3) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_LIN] [varchar] (7) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_COL] [varchar] (3) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_TIP] [varchar] (3) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_MOD] [varchar] (4) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_REP] [varchar] (4) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_CAP] [varchar] (10) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_PES] [varchar] (10) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_EJE] [varchar] (6) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_CHA] [varchar] (25) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_MOT] [varchar] (25) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_TRA] [varchar] (10) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_CAR] [varchar] (3) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_MAT] [varchar] (3) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_COT] [varchar] (3) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_EMP] [varchar] (11) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_PRO] [varchar] (11) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_POS] [varchar] (11) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_CON] [varchar] (11) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_NSO] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_VSO] [smalldatetime] NULL ,
[VEH_ESO] [varchar] (11) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_REG] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_VRE] [smalldatetime] NULL ,
[VEH_TAR] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_VPR] [bit] NOT NULL ,
[VEH_CIV] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_VCI] [smalldatetime] NULL ,
[VEH_FPP] [smalldatetime] NULL ,
[VEH_FUP] [smalldatetime] NULL ,
[VEH_VAL] [money] NULL ,
[VEH_ASE] [money] NULL ,
[VEH_NTO] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_VTO] [smalldatetime] NULL ,
[VEH_BLO] [bit] NOT NULL ,
[VEH_TEN] [varchar] (3) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_FOT] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_FEC] [smalldatetime] NULL ,
[VEH_LTR] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_FLT] [smalldatetime] NULL ,
[VEH_AND] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_FAN] [smalldatetime] NULL ,
[VEH_TMO] [varchar] (3) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_CAT] [varchar] (3) COLLATE Modern_Spanish_CI_AS NULL
) ON [PRIMARY]
GO



Gracias

Diego
 

Leer las respuestas

#1 Alberto D.
19/01/2005 - 00:36 | Informe spam
Checa que la tabla no tenga triggers ;)

Saludos !!

"Romero Diego" escribió en el mensaje
news:%23EYwaWb$
Hola
Amigos del grupo
Me esta sucediendo algo estraño con la siguiente instrucción UPDATE :

UPDATE VEHICULOS SET



VEH_MOD='1999',VEH_COL='003',VEH_EJE='2',VEH_CAT='',VEH_CAP='',VEH_PES='35',
VEH_REP='',VEH_CAR='001',VEH_MAT='',VEH_COT='',VEH_TMO='',VEH_TAR=''



,VEH_CIV='54412125',VEH_NSO='554451212',VEH_NTO='',VEH_REG='2151212',VEH_FOT
='',VEH_LTR='',VEH_AND='',VEH_VCI='20051130',VEH_VSO='20051130'



,VEH_VTO='20050520',VEH_VRE='20051130',VEH_VAL=0,VEH_ASE=0,VEH_CON='12300300
',VEH_ESO='9263799',VEH_EMP='',VEH_LIN='CH009',VEH_MAR='CH'



,VEH_TIP='001',VEH_MOT='74555A54411',VEH_CHA='22415121225',VEH_TRA='',VEH_BL
O=0,VEH_PRO='145500500',VEH_POS='145500500',VEH_TEN='001' WHERE
VEH_PLA='JLA802'

El problema es que al modificar el valor de la columna VEH_BLO=0 se
actualiza tambien la columna VEH_VPR a 0, la cual NO va en la instrucción
porque no se permite actualizar.
Lo estraño es que si quito de la instrucción VEH_BLO=0 la columna VEH_VPR
mantiene su valor
¿ por que ?

Ambas columnas son tipo BIT ¿Tiene que ver eso ?

Le envio el script de la tabla , la cual no tiene relaciones, ni trigger,


ni
check , nada especial


if exists (select * from dbo.sysobjects where id > object_id(N'[dbo].[VEHICULOS]') and OBJECTPROPERTY(id, N'IsUserTable') 1)
drop table [dbo].[VEHICULOS]
GO

CREATE TABLE [dbo].[VEHICULOS] (
[VEH_PLA] [varchar] (10) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_MAR] [varchar] (3) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_LIN] [varchar] (7) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_COL] [varchar] (3) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_TIP] [varchar] (3) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_MOD] [varchar] (4) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_REP] [varchar] (4) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_CAP] [varchar] (10) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_PES] [varchar] (10) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_EJE] [varchar] (6) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_CHA] [varchar] (25) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_MOT] [varchar] (25) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_TRA] [varchar] (10) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_CAR] [varchar] (3) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_MAT] [varchar] (3) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_COT] [varchar] (3) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_EMP] [varchar] (11) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_PRO] [varchar] (11) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_POS] [varchar] (11) COLLATE Modern_Spanish_CI_AS NOT NULL ,
[VEH_CON] [varchar] (11) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_NSO] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_VSO] [smalldatetime] NULL ,
[VEH_ESO] [varchar] (11) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_REG] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_VRE] [smalldatetime] NULL ,
[VEH_TAR] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_VPR] [bit] NOT NULL ,
[VEH_CIV] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_VCI] [smalldatetime] NULL ,
[VEH_FPP] [smalldatetime] NULL ,
[VEH_FUP] [smalldatetime] NULL ,
[VEH_VAL] [money] NULL ,
[VEH_ASE] [money] NULL ,
[VEH_NTO] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_VTO] [smalldatetime] NULL ,
[VEH_BLO] [bit] NOT NULL ,
[VEH_TEN] [varchar] (3) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_FOT] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_FEC] [smalldatetime] NULL ,
[VEH_LTR] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_FLT] [smalldatetime] NULL ,
[VEH_AND] [varchar] (20) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_FAN] [smalldatetime] NULL ,
[VEH_TMO] [varchar] (3) COLLATE Modern_Spanish_CI_AS NULL ,
[VEH_CAT] [varchar] (3) COLLATE Modern_Spanish_CI_AS NULL
) ON [PRIMARY]
GO



Gracias

Diego






Preguntas similares