, , , . : -
create table
col1value varchar (50),
col2value int,
col3value decimal(10, 5),
col4value date,
col5value datetime
);
insert into
(null,1,234.567,'2013-12-20','2013-01-07T17:30:24.567'),
('def',null,987.645,'2013-12-21','2013-01-01'),
('abc',17,null,'2013-12-20','2013-10-07T11:31:21.517'),
('jkl',2,3232.32,null,'2013-01-01 01:02:03.456'),
('mno',2,7.4006,'2012-07-04',null)
: -
select 'insert into #myTable values (' +
isnull('''' + col1value + '''','null') + ',' +
isnull(convert(varchar(50),col2value),'null') + ',' +
isnull(convert(varchar(50),col3value),'null') + ',' +
isnull('''' + convert(varchar(50),col4value) + '''','null') + ',' +
isnull('''' + convert(varchar(50),col5value,121) + '''','null') +
')'
from
: -
insert into
insert into
insert into
insert into
insert into
( ), insert. - - - ( ).
factory (.. SP, ), ).
, - , .