Ver Mensaje Individual
  #7 (permalink)  
Antiguo 20/03/2015, 10:57
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: Llenar mi tabla calendario

para llenar un calendario de forma sencilla

Código SQL:
Ver original
  1. DECLARE @inicio datetime
  2. DECLARE @final datetime
  3. DECLARE @dias INT
  4. DECLARE @x INT
  5. SET @x=1
  6. SET @inicio=getdate()
  7. SET @final=getdate()+10
  8. SET @dias=datediff(dd,@inicio,@final)
  9. while @x<=@dias
  10. BEGIN
  11.     print dateadd(dd,@x,@inicio)
  12. SET @x=@x+1
  13. END

y no es susceptibilidad, es un poco de trolleo ;)
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me