Ver Mensaje Individual
  #6 (permalink)  
Antiguo 19/03/2015, 10:16
Avatar de Libras
Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 17 años, 8 meses
Puntos: 774
Respuesta: SUmar dos registros

que tipo de dato es Doc_NumUltimo???

vamos por partes:

Código SQL:
Ver original
  1. SELECT replicate('0',8-len(Doc_NumUltimo))  FROM dbo.Serie_Maximo_Correlativo WHERE Num_Serie='004'
  2. SELECT CONVERT(VARCHAR(20),Doc_NumUltimo+1)  FROM dbo.Serie_Maximo_Correlativo WHERE Num_Serie='004'
Por separado que regresa tu query??
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me