posted on Nov, 30 2012 @ 01:06 AM
Please, bury the hatchet; put my trolling history aside for a moment.
One of my graduate classes is database management systems. You must know how to use MySQL and know syntax for triggers to help me here and show your
strength.
This is a 10 point extra cred assignment that has nothing to do with what we've been learning and, sadly, it shall likely determine if I get an A (if
it's done) or a B. I'm at precisely 765/850 right now overall (exactly 90.0! OmG) but with 3 killer assignments to be graded still. My cushioning
would be larger than 765 but a ho had to get smacked and an assignment had to be missed. I'm running out of time. Time to complete this: 23 hours.
Here's the assignment I need syntax for.
Design two tables, one which is transactional and another that tracks the history of the first table. Use table triggers to track all changes and
when they happened to table1 and store the changes in table2.
Given Table1 design:
-------------------------------------------------------
CREATE TABLE [dbo].[Tests](
[Test_Id] int IDENTITY(1,1) NOT NULL,
[Result_On] datetime NOT NULL,
[Entry_On] datetime NOT NULL,
[Result] Varchar(25) NULL)
------------------------------------------------------
Design Table2 and triggers for a Delete, Insert, and Update in your individual SQL server database.
1- Provide sql script for table 2 (Test_history)
2- Provide sql script for the Delete Trigger, Insert Trigger and Update Trigger
Here is Table2, Test_history, that I designed (edit as you see fit. It queries just fine tho).
CREATE TABLE [dbo].[Test_history] (
[Test_Id] int IDENTITY(1,1) NOT NULL,
[Result_On] datetime NOT NULL,
[Entry_On] datetime NOT NULL,
[Result] Varchar(25) NULL,
[modification_time] datetime not null,
[reason] Varchar(25) null);
So only step #2 must be done. I not only don't have SQL (at home) so can't check my work on it, but eyeing over the syntax for DML triggers without
guidance doesn't help...and I have no time (doing 2 other assignments).
Link 1 for syntax help
Link 2 for
syntax help
Can some knowledgeable soul please provide the SQL syntax for this table for INSERT, DELETE, and UPDATE TRIGGERS?
I will go through your posts and give you 15...no, 20 stars for it. Stars to strengthen your virtual presence with when debating your favorite
conspiracies and stars you may use to attract all kinds of ATS vixens (on the off-chance that you have a vagina here and still know SQL syntax then
it's HUNKS FOR YOU). The benefits are endless. You may also get 3 MasonicFantom beckoning uses. Whenever you need someone to back you up in a thread,
or eviscerate another's opposing view, just blow the special horn you'll be given and I'll show up to rock em like a hurricane.
THANKS
edit on 30-11-2012 by MasonicFantom because: (no reason given)