Friday, February 10, 2012

insert into tablename(column1,2,3...) exec spname ,using parameter table

Declare

@tablevar table(centername varchar(100),collection bigint,[transaction date] datetime,GrossAmount bigint,Discount bigint,NetAmount bigint,Due bigint,card bigint,cheque bigint,totalcollection bigint,center int,cash bigint)

insert into @tablevar(centername,collection,[transaction date],GrossAmount,Discount,NetAmount,Due,cash,card,cheque,totalcollection,center) Exec [usp_DayBookTotal] '12/10/2011','12/10/2011','%',1,'100'

SELECT centername,collection,[transaction date],GrossAmount,Discount,NetAmount,Due,card,cheque,totalcollection,center FROM @tablevar

No comments:

Post a Comment