Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
susan_151615
Yak Posting Veteran
99 Posts |
Posted - 2009-08-27 : 03:07:39
|
| Hi am generating bill using DTS.whatever be the number of records which is passed it takes all the records and pass it.Now i need to limit the number of records which is getting passed to 100.there is an insert statement which inserts the valuse sin the bill from a staging table topa mina table.A field "Data " is set in it which will take the value which is present inside the bill.INSERT INTO BR4eBillExportStaging ( ProgramID , FileSection , EBillInvoiceID , LineNumber , Data ) SELECT @i_CurBillProgID, 3 , NULL, NULL, 'T' + CONVERT(CHAR(10),@i_BatchID) --Batch ID + CONVERT(CHAR(10),@i_CurBRecsCount) --Count of B Records + CONVERT(CHAR(10),@i_CurPRecsCount) --Count of P Records + CONVERT(CHAR(20),@i_CurLRecsCount) --Count of L Records + CONVERT(CHAR(35),@m_CurTotChargeAmt) --Total Charge + CONVERT(CHAR(35),@m_CurTotBillAmt) --Total Bill AmountNow i need to modify it in order to limit the number of records been sent.Can anyone help me on this.Each record in the bill has 3 sections B,P,Lsusan |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-08-27 : 09:32:34
|
| you need to use TOP 100 in select to limit the insert to 100 records. You need to determine an order in which you want to take 100 records and specify it in select by means of an ORDER BY. otherwise,it just gives you 100 random records always. |
 |
|
|
|
|
|
|
|