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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to get the count of records in this file..

Author  Topic 

bfunny21
Starting Member

4 Posts

Posted - 2011-03-18 : 12:38:50
i m creating this file from temp table using ssis ... sql server 2005..i m writing a Sql query on the oledb source to get this file ... i have the correct file with header , details and record but i m not able to include this row count in my trailer row.... how to do this ...
here are two tables which are the building blocks of this query.. suppose table A as

account_num account_cost
111 1000
112 2000
table B as

account_number Transaction_num trans_date
111 123 03/11/2011
111 234 03/12/2011
112 999 03/07/2011
112 888 03/14/2011
and i want my txt file output as

Headerrow as date 031711
111 1000
11112303112011
11123403122011
112 2000
11299903072011
11288803142011
trailerrow as 031711 and number of record is 6
   

- Advertisement -