Hi Mike,
I've showed the simplified version. The field list is much longer and I want to have a flexibility to pass it to a function.
>Why are you using Dynamic SQL?
>This is harder. The first question is: do you really need to? Could you use derive tables or views to remove the need for creates a bunch of result sets that later get combined. If not, you have your choice of temporary tables or table variables with table variables being the perferred choice, as long as your running at least SQL Server 2000.
>
>-Mike
I want to have an SP, which would retrieve 3 resultsets (fields are different depending on category) and in addition calculate total before tax, full number of records and total after tax per each resultset, I also want to update Cart table with Checkout = 'Y', Total = sum of these, Number of recs, Total after tax.
I can create 3 select statements for my resultset, but I'm in dark about items 2 and 3. Do you have suggestions? TaxRate is different depending on the state.
================
BTW, in triggers can you have rollback transaction without begin transaction at the top, as you showed on page 55 of your book?
Thanks.
If it's not broken, fix it until it is.
My Blog