Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use MICROSOFT SQL SERVER language to fill the block like (...) Here is the diagram 1)Create a triggerthat allows insertinga new category through the view.

Use MICROSOFT SQL SERVER language to fill the block like (...)

Here is the diagram

image text in transcribed

1)Create a triggerthat allows insertinga new category through the view. If the parent category is null, throw an exception and exit.

image text in transcribed

2)Test the trigger. The solution contains the commands for the test and the results as well.

Try it without a parent category

insert into..................... write here you code

... and with parent category

insert into ..................... write here you code

.... finally with an erroneous parent

insert into ..................... write here you code

Payment Method Order ID 9 ID Date Method Deadline PlaceOfBusiness ID Zip Code City Street Deadline PlaceOfBusinessID StatusID Payment Methodid Customer Y ID Name BankAccount Login Password Email MainPlaceOfBusiness Fax Customer Status 8 ID Name Invoicelssuer 9 ID Orderltem ID Amount Price Order D ProductiD StatusID Category 9 ID Invoice* Y ID CustomerName CustomerZipCode Customer City Customer Street PrintedCopies Cancelled Payment Method CreationDate DeliveryDate Payment Deadline InvoicelssuerlD Order Name ZipCode City Street Taxidentifier BankAccount Name ParentCategory Product VAT Y ID Name Invoiceltem Price Percentage Name Amount InStock VATID CategoryID Description Image Price VATPercentage InvoicelD OrderitemID create trigger CategoryParentTG on CategoryParentVW instead of insert as begin declare @newName nvarchar(255) declare @parentName nvarchar(255) declare ic cursor for select * from inserted open ic fetch next from ic into @newName, @parentName while @@FETCH_STATUS = 0 begin declare parentid int if @parentName is not null begin (..... .....) write here you code end (.............) write here you code end close ic deallocate ic end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

3 What are the stages of Kotter and Cohens model of change?

Answered: 1 week ago

Question

1.who the father of Ayurveda? 2. Who the father of taxonomy?

Answered: 1 week ago

Question

Commen Name with scientific name Tiger - Wolf- Lion- Cat- Dog-

Answered: 1 week ago

Question

7. Determine what feedback is provided to employees.

Answered: 1 week ago