Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to maintain a value in calculated column
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01478568
Message ID:
01478576
Vues:
28
>>However, if you need to keep it, you can create a calculated column in your table (you can even make it persistent).
>>
>>The calculation formula will be
>>
>>dbo.ufnTotalAmount(OrderID) where ufnTotalAmount will be a function in your database.
>>
>>I answered this question a few months ago with more code in T-SQL MSDN forum, but I believe this will be enough info for you.
>>
>>
>>Alternative solution will be in having triggers on the Child Table(s) that will update Parent's table.
>
>What is "persistent" column?

http://msdn.microsoft.com/en-us/library/ms191250.aspx
>
>I am learning towards a function in database since I have never done triggers.
>
>Thank you.

Either way will work - but I probably chose computed column myself.
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