2. Table of Contents
Introduction: 3
JungleBooks, T–SQL: 4
PiggyBank –Bank Online, T–SQL: 12
MiniAdventureWorkDB –Integration Services: 27
MiniAdventureWorkDB –Reporting Services: 51
BlockFlix –Online Video Streaming –Integration Services: 67
BlockFlix –Online Video Streaming –Reporting Services: 91
BlockFlix –Online Video Streaming –T-SQL: 101
BlockFlix –Online Video Streaming –High Availability : 104
About Me 116
2
3. Introduction
This portfolio contains many examples of my development skills
gained in the SQL Server Master Program. It is a result of my hard
work during a 15-week hands-on experience with The SetFocus SQL
Master’s Program.
SetFocus utilizes Microsoft Official Curriculum in conjunction with its
own materials to produce the following coursework:
RDBMS , .NET, XML and CSV
Querying multiple database objects using Transact SQL (T-SQL) MS SQL Server 2008R2
Implementing and maintaining a MS SQL Server 2008 and 2008R2 Database
Designing multiples MS SQL Server 2008R2 Infrastructures for different purposes
Designing security for MS SQL Server 2008R2
Designing High Availability Database Solutions using MS SQL Server 2008R2
Troubleshooting and Optimizing Database Servers using MS SQL Server 2008R2
Extracting, Transforming and Downloading Database using SQL Server Integration
Services 2008R2
Designing, Deploying and Analyzing Database Report using SQL Server Reporting
Services 2008R2
3
4. JungleBooks:
Junglebooks is a book company which has a database consisting of
books, authors, orders and customers.
This short project contain a database diagram and its database that was
created according to instructor’s specification.
JungleBooks is a SQL Server application that support a client
application platform using .NET.
We have create queries for three store procedures to support three
basic operation against the JungleBooks.
BooksQuantityPerCustomerOrder – this application displays books
quantity per customer order.
CustomerCardInformation –this application displays the customer ‘s
current card information
CheapUnitPriceBook –this procedure displays the list of books less
than the customer given unit price
4
5. JungleBooks Database Diagram
Orders
Customers OrderID
CustomerID
CustomerID
Name
OrderDate
Address
CardType
CardNumber
ExpiryDate
OrderItems
OrderItemID
OrderID
ISBN
QuantityOrdered
QuantityDispatched
UnitPrice
BookAuthors
BookAuthorID Books
ISBN ISBN
AuthorID Publisher
Title
UnitPrice
Abstract
Pages
Authors
Published
AuthorID
Stock
Name
5
7. JungleBooks:
BookQuantityPerCustomerOrder –this procedure displays books
quantity per customer’s order based on Customer ID
Using this syntax to execute the procedure we get displayed the Customer
books quantity per order based on Customer ID
7
9. JungleBooks:
CustomerCardInformation –this procedure displays the current
Customer Card information for book order based on Customer ID
Using the syntax below to execute CustomerCardInformation procedure, we get displayed the
Customer ‘s current credit card information used for books order based on the last four digits of the
customer card and the Customer ID
9
11. JungleBooks:
CheapUnitPrice this procedure displays the list of all books available that
contains the price below than the Customer given Unit Price
Using the syntax below to execute CheapUnitPrice procedure, we get displays the
list of all books available that contains the price below than the Unit Price provided
by the Customer
11
12. PiggyBank:
Piggy Bank is a mini-project that simulates an online bank operations.
Such as check account balance, making deposit, withdraws, and
transfer money to different Accounts and making transactions
through this online bank platform.
The piggy bank contains useful information that would be used as
reference in future project. It contains an Entity Relationship
Diagram of the tables used in the project. Such as Account, Account
Status, Account Type, Customer, Customer Account, Transactions,
Transaction Type.
Piggy Bank mini-project support internal operations. Such as add
new customer, update an existing customer, add new account, an
existing update account, update interest rate for a specific customer
and account. Get a customer and account current and past history.
Piggy Bank mini-project, originally download all customers and
accounts information through the technique of extracting it from a
xml file into SQL Server entities.
12
14. PiggyBank:
This is XML technique used to download records from a xml file to SQL Server
Entities as it shows below. This is the beginning of the file.
14
15. PiggyBank:
XML technique used to download records from a xml file to SQL Server
Entities such as customer and account table. The end of xml the file.
15
16. PiggyBank:
XML technique used to download records from a xml file to SQL Server Entities
such as account status, account type and transaction type. End of the xml file
16
17. PiggyBank:
All records downloaded from a xml file to SQL Server Entities such as account
status, account type, transaction type, customer, etc., except for transactions .
17
18. PiggyBank:
Piggy bank Add Customer store procedure s to add new customer into the
customer table. Add Customer procedure.
18
19. PiggyBank:
Piggy bank Add Customer store procedure s to add new customer into the
customer table. Add Customer procedure.
19
20. PiggyBank:
Piggy bank execute Add Customer store procedure s to add new customer into the
customer table. Add Customer testing procedure.
Piggy bank Customer table before we add a new customer record
Piggy bank Customer table after a new customer record has being added
20
21. PiggyBank:
Piggy bank Deposit store procedures, this procedure is used to deposit money into
a Customer Account. Deposit store procedure.
21
22. PiggyBank:
Piggy bank Deposit store procedure is used to transfer money from one Customer Account into
a Customer Account. Deposit store procedure.
22
23. PiggyBank:
Piggy bank Deposit store procedures, this procedure is used to deposit money into
a Customer Account. Deposit store procedure.
Piggy bank Deposit procedures, Before we make a deposit into a Customer Account and transactions
Tables, we can check the Customer ID # 1, Account ID # 100000, and Transaction ID # 9
Piggy bank Deposit procedures, After a deposit has being made into a Account and transactions tables,
we can check the Customer ID # 1, Account ID # 100000 and Transaction ID # tables
23
24. PiggyBank:
Piggy bank Transfer store procedures is used to transfer money from one Customer Account
into another Customer Account. Transfer procedure Part-A
24
25. PiggyBank:
Piggy bank Transfer store procedures is used to transfer money from one Customer Account
into another Customer Account. Transfer procedure Part-B
25
26. PiggyBank:
Piggy bank Account table Before we transfer money from one Account to another Account.
Transfer money from Account ID # 100072 to Account ID # 100070
Piggy bank Account table After the transfer of money from one Account to another Account
has being made. Transfer money from Account ID # 100072 to Account ID # 100070
26
27. MiniAdventureWorksDB
MiniAdventureWorksDB is a SQL Server project that simulate the
Phoenix environment 0f Datacenter company. The project contains SSIS
basic functions and complex packages as well as SSRS functions.
In this project database goes under transformation process, in which we
implement the technique to download data from .csv files to SQL Server
Entities.
The database is downloaded from SOURCEFILES directory that contains
several .csv files, such as VendorMaster, ProductMaster,
ShipmethodMaster, UpdateProducts, PODATA_2001, PODATA_2002,
PODATA_2003, and PODATA_2004,
Using SSIS technique we developed several packages to import data from
.csv files to MiniAdventureWorksDB database, the following packages
were built:
CreateDatabase.dtsx, ImportVendors.dtsx, ImportProducts.dtsx,
ImportShipMethod.dtsx, ImportOrders.dtsx, UpdateProducts.dtsx, and
MasterPackage.dtsx
27
28. MiniAdventureWorksDB
MiniAdventureWorksDB project has the SQL Server Entities, Vendor, Product,
ShipMethod, PurchaseOrderHeader, and PurchaseOrderDetail.
In which we download the data from the .csv files through a transformation process.
The following Diagram describe the relationship between the entities
PurchaseOrderDetail PurchaseOrderHeader *
PurchaseOrderDetailID PurchaseOrderID
ShipMethod *
PurchaseOrderID POHeaderNumber
ShipMethodID
ProductID VendorId
Name
OrderQty ShipMethodId
DateInserted
UnitPrice OrderDate
DateModified
TotalDue Freight
DateInserted TotalDue
DateModified DateInserted
DateModified
Product Vendor *
ProductID VendorID
ProductNumber AccountNumber
ProductName Name
ListPrice CreditRating
DateInserted DateInserted
DateModified DateModified
28
29. MiniAdventureWorksDB
CreateDatabase.dtsx package, is the first package we employed in our transformation of
importing data from the .csv files into the five SQL Server tables. This package use a Drop
and Create Database.sql file that allow us easy data handle, I set the data to multiple user.
29
30. MiniAdventureWorksDB
CreateDatabase.dtsx package, create the five tables and other and T-SQL applications
such as functions, triggers, store procedures and other code. Such as common table
expression used for data manipulation
30
31. MiniAdventureWorksDB
We run CreateDatabase.dtsx package and it turn green that mean the package
executes its task successfully by creating the MiniAdventureWorksDB database
31
32. MiniAdventureWorksDB
TheCreateDatabase.dtsx package already create the MiniAdventureWorksDB
database and the empty tables as it show, ready to receive the data records
32
33. MiniAdventureWorksDB
ImportVendor.dtsx package, import all Vendors data files from VendorMaster.csv files
into Vendor table. The database go through a processing while it is transform by
ImportVendor package before it is downloaded into the SQL Server Vendor table
The VendorMaster.csv file import 92 Vendors to the Vendor table.
33
34. MiniAdventureWorksDB
ImportVendor.dtsx package, use a control flow task and a data flow task to
import data from the VendorMaster.csv files into Vendor table.
34
35. MiniAdventureWorksDB
ImportVendor.dtsx package, when it run and turn green mean that all Vendors
record were imported from the VendorMaster.csv files to Vendor table
successfully. 92 Vendors were downloaded into Vendor table
35
36. MiniAdventureWorksDB
This is a Vendor table after we run the ImportVendor.dtsx package to
import all Vendor records to the Vendor table.
36
37. MiniAdventureWorksDB
ImportProducts.dtsx package, it contains a control flow and two data flow; Import Products and Updated
Products data flows.
Import Products contain a Flat File Source, a Data Conversion, a Lookup Products, a Row Count data flow,
an OLEDB destination, a Conditional Split, a Row Count data flow, and an OLEDB Command.
Update Products contain a Flat File Source, a Data Conversion, a Lookup Products, a Row Count data flow,
an OLEDB destination, a Conditional Split, a Row Count data flow, and an OLEDB Command.
37
38. MiniAdventureWorksDB
Import Products contain a Flat File Source, a Data Conversion, a Lookup
Products, a Row Count data flow, an OLEDB destination, a Conditional Split,
a Row Count data flow, and an OLEDB Command. The package import 280
rows of products into Product table.
38
39. MiniAdventureWorksDB
Update Products contain a Flat File Source, a Data Conversion, a Lookup
Products, a Row Count data flow, an OLEDB destination, a Conditional Split,
a Row Count data flow, and an OLEDB Command. The Update Product data
flow update no rows in the Product table.
39
40. MiniAdventureWorksDB
This is a Product table after we run the ImportProducts.dtsx package to
import 280 Product rows into the Product table.
40
41. MiniAdventureWorksDB
ImportOrders.dtsx package, import all Orders from PODATA_2001 to PODATA_2004 flat
files into 2 flat file destinations called BadVendors.csv and BadProducts.csv. The
ImportOrders.dtsx contains 3 file system tasks, one to create a folder to output
BadVendors.csv and BadProducts.csv. The 2nd and the third file system task are used to
delete BadVendors.csv and BadProducts.csv files once they have being processed. It has a
for each loop container to loop through all PODATA Orders related to BadVendors and
BadProducts and import them into PurchaseOrderHeader and PurchaseOrderDetail
tables
The for each loop container have 2 data flows to process PODATA.csv files to import
Orders into PurchaseOrderHeader and PurchaseOrderDetail tables. It contains a file
system task to move all processed PODATA files into a folder named ProcessedFiles. The
for each loop container also has a script task that is used with 2 lines of code that use
variables to count the number of Orders per Vendors. The script task use the variables
TotalNumberBadVendors, TotalNumberBadProducts, NumberBadVendors and
NumberBadProducts for this purpose.
The ImportOrders.dtsx package use a script task to script the email connection, because
using the send mail task does not works due to server connection problem. It was
necessary to script my email connection to send an email as a result of the successful
completion of the ImportOrders.dtsx package
The ImportOrders.dtsx package import 642 rows of Orders related to Vendors and
Products into the PurchaseOrderHeader and 1,072 rows of Orders related to Vendors and
Products into the PurchaseOrderDetail tables. Upon successful completion of import
orders into the tables, the packages pick up the output files BadVendors.csv and
BadProducts.csv from ProcessedFiles folder and send it as an attachment a managerial
department.
41
42. MiniAdventureWorksDB
ImportOrders.dtsx package, is the most complex package of the MiniAdventureWorksDB
project. It involved the use of many SSIS components to achieve a variety of functions on the
database. Starting by extracting the data from .csv files and transforming it into an statistical
data, and upon completion it notifies the department involved with such a data.
42
43. MiniAdventureWorksDB
ImportOrders.dtsx contains 18 variables, each one accomplishes specific task.
Such as connection string of directory path.
43
44. MiniAdventureWorksDB
The IMPORTPODATA_csv data flow import 642 rows of Orders related to
Vendors and Products into PurchaseOrderHeader table.
44
45. MiniAdventureWorksDB
The Building PODetail data flow import 1,072 rows of Orders related to
Vendors and Products into PurchaseOrderDetail tables
45
46. MiniAdventureWorksDB
These are the PurchaseOrderHeader and PurchaseOrderDetail tables after
importing the Orders from PODATA.csv files. Both tables contained Orders
detail related to Vendors and Products.
46
47. MiniAdventureWorksDB
The Script task named send AOL mail, send a mail to my email recipient by
scripting the connection string of the server, using the following code. Scripting
the connection string to my email, the send mail script task accomplish the final
task.
47
48. MiniAdventureWorksDB
The Script task named send AOL mail, send a mail to my email recipient by
scripting the connection string of the server, using the following code. Scripting
the connection string to my email, the send mail script task accomplish the final
task.
48
49. MiniAdventureWorksDB
The is the mail with the attachment of BadVendors.csv and BadProducts.csv
files containing 108 Vendors row and 11954 Products rows related to vendors.
49
50. MiniAdventureWorksDB
The MasterPackage.dtsx package use 6 execute package tasks connected to start
the data transformation in an orderly way. It executes all packages in sequence
and organized way to accomplish the requirements of MiniAdventureWorksDB.
50
51. MiniAdventureWorksDB
MiniAdventureWorksDB Project contains two essential part the
SSIS data transformation and the SSRS reporting services. This is
the Reporting Services part which contains 2 report applications
that use from basic ad hoc queries to store procedures. The
rtpSalesMatrixByYear.rdl is a report application that contain
several text boxes.
Such as Vendor Sales By Year, and 4 others text boxes that contain
information about the user running the report, the server in which
the report is running, the date and time. The report also use a
Matrix task that holds data about the name, the sum of totalDue
by Year the total due.
The report contains the shared
MiniAdventureDataSourceMatrix.rds data source. The
rptVendorSalesByYear.rdl report contains the VendorSalesByYear
dataset, as well as ServerName, ServerDateTime and
ShipMethod_Name datasets.
51
52. MiniAdventureWorksDB
The rptVendorSalesByYear.rdl report use an ad hoc query to select Vendor Name,
Year Order Date and the Sum of Total Due from Vendor and
PurchaseOrderHeader table based on ShipMethodID and group by Vendor Name.
52
53. MiniAdventureWorksDB
The report contains a VendorSalesByYear dataset that use an ad hoc query to select
Vendor Name, Year Order Date and the Sum of Total Due from Vendor and
PurchaseOrderHeader table based on ShipMethodID and group by Vendor Name.
53
54. MiniAdventureWorksDB
This is the top of the rptVendorSalesByYear.rdl report, view from the reporting
server web server.
54
55. MiniAdventureWorksDB
The report contains a TOP5ProductsForVendors dataset that use a store procedure
and a function to select Vendor Name, Rank, Total Due, Product Name, Product
Rank and Product Total Due from Vendor and PurchaseOrderHeader and
PurchaseOrderDetail tables based on VendorID and group by Vendor Name.
55
56. MiniAdventureWorksDB
The report contains a TOP5ProductsForVendors dataset that use a store procedure
and a function to select Vendor Name, Rank, Total Due, Product Name, Product
Rank and Product Total Due from Vendor and PurchaseOrderHeader and
PurchaseOrderDetail tables based on VendorID and group by Vendor Name.
56
57. MiniAdventureWorksDB
This is the GetTop5ProductsOrdersFromVendors store procedure that invoke the
GetTopNProductsOrdersFunctions to retrieve Vendor records.
57
58. MiniAdventureWorksDB
This is the GetTopNProductsOrdersFunctions that retrieve Vendor information
from PuchaseOrderHeader and PurchaseOrderDetail tables.
58
59. MiniAdventureWorksDB
This is the result set of executing the GetTopNProductsOrdersFunctions function
after retrieve Vendor records.
This is the result set of executing the StoreProcGetTopNVendors_TopNProducts procedure
that output the result set with Vendor records from GetTopNProductsOrdersFunctions.
59
60. MiniAdventureWorksDB
This is the top of the rptTopSales.rdl report, view from the reporting server web
server.
60
61. MiniAdventureWorksDB
This is the bottom of the rptTopSales.rdl report, view from the reporting server
web server.
61
62. MiniAdventureWorksDB
This is the Home Report Manager website of my SQL Server, and the
MiniAdventureWork_Reports contain 2 reports that can be accessed directly by
clicking on them. Each report has a folder and a linked report with the same
name to protect the original reports
62
63. MiniAdventureWorksDB
Here we configured a report delivery for an unattended report delivery. A report
would be delivered to a shared folder destination called
MiniAdventureSharedReports.
63
64. MiniAdventureWorksDB
These are the subscriptions that already have delivered the unattended reports to a
shared destination folder named MiniAdventureSharedReports.
64
65. MiniAdventureWorksDB
This is the MiniAdventureSharedReports folder containing 2 reports by a
scheduled subscription delivery of the unattended reports to this recipient.
65
66. MiniAdventureWorksDB
This is the opened LinkedrptTopSales.pdf report that was delivered by a
scheduled subscription to MiniAdventureSharedReports folder.
66
68. BlockFlix-Final Project
Block-Flix Project Team I Instroductions
◦ Silas Taylor, Project Manager
◦ Luanna Rozentals, Asst Project Manager
◦ Angela Johnson
◦ David MacDonald
◦ Marino Mercedes
◦ Ivette Calloway
68
69. Block-Flix Final Project
Block-Flix Final Project simulate operations for a new upcoming Movie
rental company. The company will have opened a few store nationwide
and is in the process of creating a centralized database for tracking
inventory, sales, customers and memberships.
The company has an online store where customers can buy or rent movies
or video games. Online stores has a database that will keep track of
customer transactions (Sell/Rent or return of movies). The transact
information is saved in a File Stream or .CSV file which is later uploaded
into the central database to use and distribute customer and movie titles
information.
SetFocus Team I and me have developed some applications for the project
that can be used by a .Net platform in conjunction with SQL Server to
fulfill customers requirements. However, some of the application were
complete by our group team I. I decided to redo the whole project by
correcting applications that didn’t work, uncompleted application adding
some new applications.
69
70. Block-Flix Final Project
Block-Flix Final project contains three main parts: The SSIS Applications to
executes many packages, The SSRS Applications to run many reports, and
the T-SQL codes that supports those applications.
The SSIS Project part contains 10 SSIS packages as follow: CreateDatabase,
AddMedia, AddMovie, AddMovieCast, AddInventory, AddCast,
AddCastType, ReseedTables, OnlineVideoStreaming, ExcutePackages.
The SSRS Project part contains 7 reports as follow:
CustomerMembership.rdl, GetMostActiveCustomerByTheMonthAndYear.rdl,
GetMostRentedMovieByTheMonthAndYear.rdl,
MostActiveCustomerOfTheMonth.rdl, MostRentedMovieOfTheMonth.rdl,
LostDamagedCustomerReport.rdl, and OnlineVideoStreaming.
T-SQL Applications that support both parts of the project are as follow:
GetMonthName, GetMostRentedMovieByTheMonthAndYear,
GetMostRentedMovieByTheMonthAndYear,
MostActiveCustomerOfTheMonth, MostRentedMovieOfTheMonth,
NotifyLostDamagedVideos, UpdateLostDamaged, OnlineVideoStreaming,
BuyMovie, RentMovie, ReturnMovie, UpdateMonthyFeeBilling and others.
70
71. Block-Flix Final Project
This is Block-Fix Database Diagram that show all entities that support Block-Flix
Final Project
Account AccountQueue
CustomerAccount AccountID QueueID
CustomerAccountID
Pay mentTy peID AccountID
CustomerID
AccountStatusID MediaID
AccountID
FeeBalance VideoLinkID
MembershipTy peID Inv entory Ty peID
CheckOutCount QueueNumber
Customer
CustomerID
CustomerFirstName
CustomerLastName
InventoryType
InventoryTypeID
MovieMedia
CustomerMiddleInitial MediaID
TypeName
Street Title
City MediaDescription
State Year
ZipCode
Genre
RatingID
GenreID
Email GenreID
GenreName
HomePhone
WorkPhone
CellPhone
Rating VideoStreamLink
RatingID VideoLinkID
Rating VideoStreamLink
CustomerCreditCard RatingDescription
RowNumber
CreditCardEncry ptedNo Inventory
CreditEx piration SKU
MembershipTypes
CustomerID Mov ieID
MembershipTy peID
AccountID Inv entory Ty peID
MembershipTy pe
AccountStatusID LocationID
Max Checkout
MembershipTy peID Quantity
Price
NoDay Late
FineCharged
CurrentCheckout Location
Balance Payment LocationID
Pay mentTy peID
LocationCity
Pay mentName
Locationty peID
LocationState
AccountStatus
LocationAddress
AccountStatusID Cast LocationZipCode
AccountStatus CastID
CastTy peID
MediaID
LocationType
CastFirstName
CastType LocationtypeID
CastTy peID CastLastName
LocationName
CastTy peName
RentDetail
RentDetailID MovieItem
TransactionType AccountID Mov ieID
TransactionTypeID Mov ieID Mov ieTitle
TransactionTypeName MediaID Price
MediaID
Transactions InventoryTransaction
TransactionID Inv entory TransactionID
MovieCast
AccountID Mov ieID
Mov ieCastID
TransactionTy peID AccountID
MediaID
CustomerID Inv entory Ty peID
CastTy peID
Pay mentTy peID TransactionTy peID
CastID
TransactionDate TransactionAmount
TransactionTotalAmount
71
73. Block-Flix Final Project
The CreateDatabase.sql SQL file that used by the file connection of the SQL
task to script all database entities. This is the beginning of the file that
creates Block-Flix database.
73
74. Block-Flix Final Project
These are the AccountQueue and Account tables scripted by a file connection
using the CreateDatabase.sql file for the BlockFlix Final Project.
74
75. BlockFlix-Final Project
AddMedia.dtsx package contains a data flow tasks that extract the Media
informations from MovieList.csv file When this task is executed download all
Movie Media information from the MovieList.csv file into the MovieMedia table.
75
76. Block-Flix Final Project
MovieMedia table that contains 10 initials rows of Movie Media information
downloaded from MovieList.csv file
76
77. Block-Flix Final Project
AddMovie.dtsx package contains a data flow tasks that extracts all Movie
informations from MovieList.csv file When this task is executed download all
Movie informations from the MovieList.csv file into the MovieItem table.
77
78. BlockFlix-Final Project
MovieItem table that contains 10 initial rows of Movie Item information
downloaded from MovieList.csv file
78
79. Block-Flix Final Project
ReseedTables.dtsx package, it contains a SQL tasks that reseed all tables in BlockFix database
by reseeding tables identities of. Once tables identities are set of it insert a new set of
information that complement the data downloaded from MovieList.csv file.
79
80. Block-Flix Final Project
These are the list of tables that SQL tasks will first delete and reseed in the
Block-Fix database.
80
81. Block-Flix Final Project
This is the Customer table that a SQL tasks will reseed in the BlockFix database
by reseeding tables identities of.
81
82. Block-Flix Final Project
OnlineVideoStreaming.dtsx package, this package contains a File
System task, a SQL tasks , a For Each Loop task, and a Script task.
The File System task create a directory to download Customer
information in a .CSV file, which later send in an email attachment to
BlockFlix customers.
The SQL tasks create an object that return a full result-set for one
specific customer of the BlockFlix database based on Customer ID.
The SQL task use a file connection that connect to an
OnlineVideoStreaming.sql file.
The For Each Loop task loop through an ADO object source that is
set to a For Each ADO Enumerator property . The ADO Enumerator
loop through a record-set of multiple tables to output a full result set.
The Script task is used to script the SQL connection and user
credential to send the result-set in a body of an email to the customer
email recipient. The Script task also output the email body
information in a CSV file attachment.
82
83. Block-Flix Final Project
This is the OnlineVideoStreaming.dtsx package and upon its successful execution it
grab the OnlineVideoStreaming.csv file and send it in an email attachment.
83
84. Block-Flix Final Project
this is the For Each Loop task Variable Mapping, it is used to map the variables that
will create the object of type result-set. The foreach loop will loops through a
record-set to output only these 7 fields base on Customer ID.
84
85. Block-Flix Final Project
this is the For Each Loop task contains a data flow task that use an OLEDB Source, a
Row Count, and a Flat File Destination. It is used to output the Customer result-
set into a flat file destination.
85
86. Block-Flix Final Project
This is the Script task contains a ReadOnlyVariables and ReadWriteVariables that
we use to read from and to write too. The Script task read the VideoCounts
variable and write the CustomerEmail along with other variables. It uses the edit
script where we script user credential and script a record-set body for the customer
email as well as the email attachment
86
87. Block-Flix Final Project
I am not a .Net developer but I did some research and get some tips on how to writ
the code in the edit task for user credential and to output customer information as
part of the email body . I have learned how write the edit script to send the
customer email with a file attachment.
87
88. Block-Flix Final Project
Here is where I define the user’s credentials and the body of the Customer email
using .Net coding application that connect to my SQL Server Instance
88
89. Block-Flix Final Project
This the opened Customer email that contains the email body with the Customer
and Video information plus the OnlineVideoStreaming.csv file attachment.
89
90. Block-Flix Final Project
The ExecutePackages.dtsx package execute successfully the 8 packages that were
executed one by one through the ExecutedPackages.dtsx packages.
90
91. Block-Flix Final Project
The BlockFlix SSRS project part contains 7 reports that are basically used for
notification of the customer’s Videos and other functions. These reports use
T-SQL code to accomplish their functions, the reports as follow:
CustomerMembership.rdl, GetMostActiveCustomerByTheMonthAndYear.rdl,
GetMostRentedMovieByTheMonthAndYear.rdl,
LostDamagedCustomerReport.rdl, MostActiveCustomerOfTheMonth.rdl,
MostRentedMovieOfTheMonth.rdl and OnlineVideoStreaming.rdl,.
These reports use store procedures to accomplish their functions as follow:
GetMonthName, GetMostActiveCustomerByTheMonthAndYear,
GetMostRentedMovieByTheMonthAndYear,
GetMostActiveCustomerOfTheMonth, GetMostRentedMovieOfTheMonth,
NotifyLostDamagedVideos and OnlineVideoStreaming.
These reports output data based on a subscription and scheduled report
delivery to a share destination folder. The email delivery is not used in this
project due to connection problem. The report information is output based
on customer ID
91
92. Block-Flix Final Project
The MostActiveCustomerOfTheMonth.rdl use a store procedure called
GetMostActiveCustomerOfTheMonth. The report output Customer information of the
most active customer of the current month.
92
93. Block-Flix Final Project
This is the MostActiveCustomerOfTheMonth.rdl report that output the most
active customers of the current month as follow:
93
94. Block-Flix Final Project
The MostRentedMovieOfTheMonth.rdl use a store procedure called
GetMostRentedMovieOfTheMonth. The report output the Movie information of the
most rented movies of the current month.
94
95. Block-Flix Final Project
This is the MostRentedMovieOfTheMonth.rdl report that output the most rented
movies of the current month as follow:
95
96. Block-Flix Final Project
The OnlineVideoStreaming.rdl use a store procedure called OnlineVideoStreaming.
The procedure output the Video Streaming Link and the Video details for customer’s
requested movies.
96
97. Block-Flix Final Project
The OnlineVideoStreaming store procedure output the Video Streaming Link and the
Video details for customer’s requested movies. The Video Streaming Link details
about the specific video must be send in an email to customer recipient.
97
98. Block-Flix Final Project
The OnlineVideoStreaming.rdl report contains the Customer’s Online Video Streaming
details about a specific movies based on Customer ID. The report output the Video
Streaming Link and the Video details for customer’s requested movies as follow:
98
99. Block-Flix Final Project
This is the customer subscription scheduled report delivery of OnlineVideoStreaming.rdl report to
be delivered to shared destination folder.
This is the customer subscription of the OnlineVideoStreaming.rdl already set up
99
100. Block-Flix Final Project
This is the scheduled report delivered to a Shared Destination folder of OnlineVideoStreaming.pdf
This is the OnlineVideoStreaming.pdf report delivered and opened in the customer recipient
100
101. Block-Flix Final Project
The BlockFlix Final project part 3 consist of the following store procedures that will
support the .Net applications to provides many functionalities to the project. Such
as Add New Customer, Update Customer, Add new Account, Update Account, Add
AccountQueue, Add Customer Credit Card, Add Inventory, Buy Movie, Rent Movie,
Return Movie, Update Lost Damaged, Update Monthly Fee Billing, Update
Membership Types.
The following store procedures were built to do functions such as:
AddNewCustomer, UpdateCustomer, AddNewAccount, UpdateAccount,
AddNewAccountQueue, UpdateAccountQueue, AddCustomerCreditCard,
GetCustomerCreditCardInfo, AddInventory, BuyMovie, RentMovie, ReturnMovie,
UpdateLostDamaged, UpdateMonthlyFeeBilling, besides those used in reporting
services.
We displays the T-SQL Code and the result-set of the following procedures:
AddCustomerCreditCard, GetCustomerCreditCardInfo, UpdateMonthlyFeeBilling,
BuyMovie, RentMovie, ReturnMovie, UpdateLostDamaged. The rest of procedures
won’t be showed here, because they belong to normal store procedure routines.
Those procedures were built to run under .Net applications such as Visual .Net,
ASP.Net or other Object Oriented languages.
101
102. Block-Flix Final Project
The RentMovie store procedure that update Movie data into Inventory, Account tables and others.
102
103. Block-Flix Final Project
The BuyMovie store procedure update Movie data into Inventory, Account, Transactions tables
103
104. Block-Flix Final Project
BlockFlix – High Cost Hardware Proposal
Central Database:
4 Dell PowerEdge 2950 III Rack Server (Configured N+1 Clusters)
◦ 2 Quad-Core Intel Xeon Processors 5400 series at 3.33GHz
◦ 8GB 667MHz Dual Ranked DIMMs
◦ Microsoft Windows Server 2008 Datacenter x64 bit
◦ Microsoft SQL Server 2005 Enterprise Edition
Dell PowerVault NX1950
◦ 6.75TB (450GB x 15 Serial Attached SCSI Hot Plug Hard Drives)
◦ RAID 1+0 Configuration
Store Database:
3 Dell PowerEdge 840 (Configured for Database Mirroring)
◦ Implemented with High Safety Mode - Witness Server for Automatic
Failover
104
105. Block-Flix Final Project
BlockFlix – High Cost Hardware Proposal
CENTRAL DATABASE – N + 1 Cluster STORE DATABASE - Database Mirroring – High Safety
mode with Automatic Failover
105
106. Block-Flix Final Project
106 Block-Flix database has a high availability to Protect the System?
Application data stores
◦ Databases
◦ Files
◦ Other data repositories
Database services
◦ DBMS availability for applications
Application services
◦ Application availability for users and external systems.
◦ Databases are the heart of most information systems;
they deserve the highest affordable protection.
106
107. BlockFlix-Final Project
107
Service Recovery Strategies for Disaster-Recovery
Standby Mode Failover Behavior SQL Server Feature
Cold • Manual intervention required to restore • Backup and restore
standby offline data copy
Warm standby • Data copy online and ready • Transaction log shipping
• Manual failover required • Database mirroring
Hot standby • Automatic failover • Database mirroring
• Failover clustering
107
108. Block-Flix Final Project
Data Recovery—Terminology
Terminology varies for source vs. copy
High Availability Strategy Data Source Data Copy
Backup and Restore Database Backup
Log Shipping Primary Secondary
Standby
Database Mirroring Principal Mirror
Failover Clustering Primary Secondary
Active Passive
Standby
Inactive
108
109. Block-Flix Final Project
An Overview of the BackUp Solution
Based on stored procedures and functions
Supports SQL Server 2005, SQL Server 2008 and
SQL Server 2008 R2 Database Backup - Backups
Database Integrity Check – Integrity Check, and
user defined database integrity
Index Optimize – Index and Statistics by using
maintenance plan to rebuilt fragmented indexes
109
110. Block-Flix Final Project
Steps to Back Up Database
Step 1: Open your Microsoft SQL Server Management Studio, whichever you prefer, standard or express edition.
Step 2: Using your Database Username and Password, simply login to your MS SQL server database.
Step 3: Select the database >> Right-click >> Tasks >> Back Up [as shown in the image below]:
Once you click on the “Backup” the following Backup Database window will appear
110
112. Block-Flix Final Project
High Availability
112 Minimize or avoid service downtime
◦ Whether planned or unplanned
When components fail,
service interruption is brief or non-existent
◦ Automatic failover
Eliminate single points of failure (as affordable)
◦ Redundant components
◦ Fault-tolerant servers
Business Case for Availability
High Availability Disaster Recovery
Keep business-critical Protect against loss of data
center
applications available
Secondary:
Secondary: ◦ Application upgrades
◦ Server maintenance ◦ Infrastructure upgrades
112
113. Block-Flix Final Project
113 Data Availability Continuum
Degrees of protection for information systems:
Business Risk Solution
Data Recovery Data loss Redundant data
High Downtime of Redundant system
Availability database service components
Disaster Downtime of Redundant systems
Recovery business operations and facilities
113
114. Block-Flix Final Project
114
Database Failure Scenarios
Physical Infrastructure
Failures Logical Data Failures
Storage subsystem Operator errors
◦ Disk ◦ DBMS interruption
◦ Controller ◦ Drops / deletes
Network Application defects
Server DBMS defects
Power Data corruption
114
115. Block-Flix Final Project
115
Transaction Log Shipping
Warm standby solution
Duplicate user database
◦ Copy transaction logs to standby server & restore
Database available for read-only access
◦ Users must disconnect for logs to be applied
◦ Two database licenses required if querying standby
Manual application failover
Supported on standard hardware
Possible data loss (unapplied transactions)
115
116. About Me
I am Marino Mercedes, I posses an Associates of Occupational Studies
(AOS) in Computer Information System(computer programming
languages). Such as SQL Server 7.0/2000, ASP 3.0, and Visual Basic
6.0 at VBScript, JavaScript at ASA College of Business and
Technologies, 10/2001, Brooklyn.
I have successfully graduated of bachelor program in computer Science
(Computer Information System and Programming Languages) at St.
Joseph College 06/2006, Brooklyn, NY.
I have a Certified Microsoft Professional (MS SQL Server 2000) and I
have worked from 02/2008 to 09/2008 for Microsoft Corporation, at
Redmond Seattle, WA as Database Administrator (Junior DBA) on
SQL Server 2005.
Actually I have successfully graduated from SetFocus SQL Master
Program. I have achieved the knowledge and hand on training as SQL
Developer as the projects have shown.
I have solid hand on how to analyze, build, deploy, implement and
troubleshoot a SQL Server Project throughout the Life Cycle. I have
implemented databases in SQL Server 2008 and 2008R2 for the many
projects. I have created functions, stored procedures, triggers, and
other database objects used as a back end of the projects’ databases to
be implemented by .Net applications. Such as Visual Studio, or
ASP.Net, I also have designed different forms and reports in MS SQL
2008R2 as the front end application for those databases.
I am actively looking for new opportunities in IT field. I have
successfully graduated from SetFocus and I am looking for a SQL
Developer position where I can use my skills and hand on training
with SQL Sever 2008 and 2008R2 at SetFocus in combination with my
technical background in Windows Systems.
I have a passion for working as database developer and I am currently
pursuing a Master Program of Software Engineering at Strayer
University.
Thank You 116