0% found this document useful (0 votes)
44 views

On AFSS 03

The document provides instructions to create a database, table, class, assembly, function, stored procedure, and web application in Microsoft SQL Server 2005. It involves: (1) creating a "Test" database and "MyProducts" table, (2) creating a class library and function to calculate subtotals, (3) inserting sample data and using the function, (4) creating a stored procedure to retrieve product data, (5) exposing the stored procedure as a web method, and (6) creating a web application to invoke the web method.

Uploaded by

Bao Koo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

On AFSS 03

The document provides instructions to create a database, table, class, assembly, function, stored procedure, and web application in Microsoft SQL Server 2005. It involves: (1) creating a "Test" database and "MyProducts" table, (2) creating a class library and function to calculate subtotals, (3) inserting sample data and using the function, (4) creating a stored procedure to retrieve product data, (5) exposing the stored procedure as a web method, and (6) creating a web application to invoke the web method.

Uploaded by

Bao Koo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Review AFSS

Using the MS SQL Server 2005, create a database named Test and write scripts to make the
following functions .
a. Create a table named MyProducts into “ Test” database contain columns : (5 marks)
- ProductID int , identity , primary key
- ProductName varchar(50)
- UnitPrice float
- Quantity int
- SubTotal float
b. Create a assembly named ProductManager.dll contain a class named Product have a method
named CalSubTotal:
float CalSubTotal ( float UnitPrice , int Quantity ) : return UnitPrice * Quantity .
Then this assembly registered into Test database to use CalSubTotal method as the Function
in SQL Server and create a function named fnSubTotal(...parameters....) invoke to
CalSubTotal method. (20 marks)
c. In Test database , create data for the Product table (5 records) by using INSERT command
and fnSubTotal function.(10 marks)
d. Create a store procedure named spAllProducts : get all information of the Product table. (20
marks)
e. Expose “spGetAllStock” store procedure become a Web method .(25 marks)
f. Create a Web Application invoke to “spGetAllStock” WebMethod . (20 marks)

1 Review AFSS | Set 03

You might also like