Home T-SQL QUERY , COUNT WITH TRAILER RECORD
 i have a code which starts with Alert procedure and follows up with header , detail and trailer statements , where as i used select distinct for header , detail and in between both header and detail there is union command , so i was wondering if i could get the total number of records from header and detail in trailer row in specific column .. for now i have used CONVERT(bigint, count(*) ) as Recordcount,  but it is displaying as 498 rows .. but we originally have 475 rows about trailer row . i think it is counting total number of sql query rows ..