sql server - Looping SQL statement insert -


i want insert each time line date + 1. it's simple sql loop. i'm using ssis, startdate , enddate variables.

here code:

with view_solidnet_training (     select cast('2013-04-09' datetime) datevalue     union      select datevalue + 1       view_solidnet_training      datevalue + 1 < '2013-04-11' ) insert obj_availability values   select 34,          datevalue + 1,          'am',          2,          'test'     view_solidnet_training; 

error message:

msg 156, level 15, state 1, line 11 incorrect syntax near keyword 'select'.

no need values in insert...select statement.

replace

insert obj_availability values   select 34,          datevalue + 1,          'am',          2,          'test'     view_solidnet_training; 

with

insert obj_availability select 34,        datevalue + 1,        'am',        2,        'test'   view_solidnet_training; 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -