Search
 
SCRIPT & CODE EXAMPLE
 

SQL

SQL create table full of dates

CREATE TABLE _Dates (
  d DATE,
  PRIMARY KEY (d)
)
DECLARE @dIncr DATE = '2000-01-01'
DECLARE @dEnd DATE = '2100-01-01'

WHILE ( @dIncr < @dEnd )
BEGIN
  INSERT INTO _Dates (d) VALUES( @dIncr )
  SELECT @dIncr = DATEADD(DAY, 1, @dIncr )
END
Comment

PREVIOUS NEXT
Code Example
::  
::  
::  
::  
::  
Sql ::  
:: ora 00001 error catch plsql 
::  
::  
Sql ::  
::  
::  
::  
::  
Sql ::  
::  
:: open link c# 
::  
::  
::  
::  
::  
::  
Csharp ::  
::  
::  
Csharp ::  
::  
::  
::  
ADD CONTENT
Topic
Content
Source link
Name
3+4 =