Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can not make query to work
Message
 
 
À
06/03/2003 23:04:34
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
00762448
Message ID:
00762713
Vues:
11
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform