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)
 Adding Header and Trailer

Author  Topic 

vincible
Starting Member

6 Posts

Posted - 2010-05-12 : 23:21:18
Need an urgent help to add Header and Trailer in the Sql extract using T-Sql. The format should be :
1)Header: 999999999+Filename+CurrentDate
2)Detailed Records
3)Trailer :99999999+No.of Records in the extract.

Please help !!!!

Thanks,
Nitin

stepson
Aged Yak Warrior

545 Posts

Posted - 2010-05-13 : 01:38:20
you can use Union all
1 select ... 999999999+Filename+CurrentDate
union all
2 detailed Records
union all
3....
Go to Top of Page

vincible
Starting Member

6 Posts

Posted - 2010-05-13 : 01:58:05
Thanks for your Reply!!!

For union all there should be equal number of columns .I think in this case it will not work.
Go to Top of Page
   

- Advertisement -