Showing posts with label Foodmart. Show all posts
Showing posts with label Foodmart. Show all posts

Friday, February 24, 2017

WWI a new sample database with SQL Server 2016

There have been a number of sample databases that debuted with various SQL Server versions starting from pubs, Northwind, Foodmart and AdventureWorks

Northwind employees have been in the limelight for years and it is time for them to retire. Some 9 employees managed the whole business and now businesses have gone global and IOT and robots are standing in queue.

In this background Microsoft has introduced the Wide World Importers, WWI for short. You can get an overview here , or read on.

This is how Microsoft describes WWI's business:

"Wide World Importers (WWI) is a wholesale novelty goods importer and distributor operating from the San Francisco bay area.

As a wholesaler, WWI’s customers are mostly companies who resell to individuals. WWI sells to retail customers across the United States including specialty stores, supermarkets, computing stores, tourist attraction shops, and some individuals. WWI also sells to other wholesalers via a network of agents who promote the products on WWI’s behalf. While all of WWI’s customers are currently based in the United States, the company is intending to push for expansion into other countries.

WWI buys goods from suppliers including novelty and toy manufacturers, and other novelty wholesalers. They stock the goods in their WWI warehouse and reorder from suppliers as needed to fulfill customer orders. They also purchase large volumes of packaging materials, and sell these in smaller quantities as a convenience for the customers.

Recently WWI started to sell a variety of edible novelties such as chilli chocolates. The company previously did not have to handle chilled items. Now, to meet food handling requirements, they must monitor the temperature in their chiller room and any of their trucks that have chiller sections."

In an importing and redistributing business the Workflow is very well defined to address all exigencies and so it is with WWI as charted by Microsoft:

Workflow of stocks:

    WWI creates purchase orders and submits the orders to the suppliers.
    Suppliers send the items, WWI receives them and stocks them in their warehouse.
    Customers order items from WWI
    WWI fills the customer order with stock items in the warehouse, and when they do not have sufficient stock, they order the additional stock from the suppliers.
    Some customers do not want to wait for items that are not in stock. If they order say five different stock items, and four are available, they want to receive the four items and backorder the remaining item. The item would them be sent later in a separate shipment.
    WWI invoices customers for the stock items, typically by converting the order to an invoice.
    Customers might order items that are not in stock. These items are backordered.
    WWI delivers stock items to customers either via their own delivery vans, or via other couriers or freight methods.
    Customers pay invoices to WWI.
    Periodically, WWI pays suppliers for items that were on purchase orders. This is often sometime after they have received the goods.

You will be hearing more about WWI in my blogs:
http://hodentek.blogspot.com
http://hodentekMSSS.blogspot.com
http://hodentekHelp.blogspot.com

The next tasks for you are:
Apply SP1 before you construct a database (WWI):

http://hodentekmsss.blogspot.com/2017/02/download-and-apply-sql-server-2016-sp1.html

Construct WWI database on the named instance by any of the following methods:

http://hodentekmsss.blogspot.com/2017/03/using-bacpac-file-to-construct-wide.html

http://hodentekmsss.blogspot.com/2017/02/constructing-wide-world-importers.html




Wednesday, January 30, 2013

How do I install a sample database using script?

When you are working with SQL Servers you may want to use database samples. Microsoft has published sample databases from time to time. Some of the databases published are,

Pubs
Northwind
Foodmart for OLAP
Adventure Works of various types.


These database samples comes in two forms; MDF & LDF files or script files which when run on the server installs the databases. The MDF and LDF files can be used to install the samples using either the Graphic User Interface (Right Click Databases node in the SQL Server Management Studio and choose Attach...) Attach menu item on SQL Server, or using T-SQL Scripts.

For SQL Server 2000 database files please follow this link: http://www.microsoft.com/enus/download/details.aspx?id=23654

For Adventure Works database files please follow this link: http://msftdbprodsamples.codeplex.com/releases

Make sure you get both the MDF and LDF files as both are needed while attaching the databases, read the following comments here, http://msftdbprodsamples.codeplex.com/workitem/19203.

For attaching the MDF / LDF files follow this link for step-by-step procedure here:

Here the use of script file to install the sample on SQL Server 2012 is demonstrated. Note that the original documentation mentions that Northwind (2000) can only be installed on Windows 2003 and Windows XP, but you can install them on a Windows 7 machine.

From the link mentioned earlier for Northwind you can download the SQL2000SampleDb.msi file to a location of you choice.
Double click the MSI fileshown here,




Double click SQL2000SampleDb.msi in the download folder location to open






Click Next and agree to license terms on the next widow that is displayed. Click Next.



Click Next.



Click Next.




The database scripts as well as mdb / ldb files will be created in C:\SQLServer2000SampleDatabases as shown.


Connect to SQL Server 2012 and create an empty database Northwind
Click File | Open |  File...
The instnwnd.sql file opens in a query window. Check Syntax.


Click Execute.
You may get the message like:

Msg 2812, Level 16, State 62, Line 2
Could not find stored procedure 'sp_dboption'.
Msg 2812, Level 16, State 62, Line 3
Could not find stored procedure 'sp_dboption'.

Comment out the sp_dboption as shown as it is deprecated in SQL Server 2012.

--exec sp_dboption 'Northwind','trunc. log on chkpt.','true'
--exec sp_dboption 'Northwind','select into/bulkcopy','true'

Click Execute

The Northwind database will fully populated as shown:



Enjoy!

Mahalo














When Identity Security Becomes a Wall — Not a Shield

After a breach that forced a reset of my digital identity, I hit a roadblock I never anticipated: multi-factor authentication (2FA) locked m...