Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Trigger Help

$
0
0
I have an issue with an application I am writing. The data model is comprised of tables that represent a system that will track inventory for IT, e.g. Computers, Software and Licenses. In order for this to be consistent, an intersect table was added, and within the License and Software tables there are columns for LicenseType and SoftwareType. I have uploaded an attachment of the data model to help with this dilemma.The database should default new software to have a trial license associated with it by default upon Software insert. I am not sure if I have the LOV table structured properly, and how to set their values and write the trigger accordingly. The values added to the LOV tables are GPL, Commercial for SoftwareType, and GPL, Commercial, and Trial for LicenseType. The SoftwareType column in the Software table and the LicenseType column in the License table have the same naming convention and should give clarity to where a particular value came from. Should these be foreign keys in their respected tables, or is no key needed here? Can I still reference the values in the LOV tables without putting foreign keys in the Software and License tables, and if so, how do I create this trigger to do what I need it to do?

Viewing all articles
Browse latest Browse all 3145

Trending Articles