Walkthrough: Migrating SofiaCarRental Database to SQL Azure
In this topic, you will move the SofiaCarRental database from SQL Server on premise to the cloud. This task will be done by using scripts.
SQL Azure supports a subset of the features that are found in the on-premise version of SQL Server. We will identify some of these differences. The goal of this topic is to give you a primer in readying exported SQL scripts for SQL Azure. This topic will not cover all the key differences between SQL Server and SQL Azure. For a complete list of commands not supported in SQL Azure, please see the SQL Azure Documentation.
To export a script for the SofiaCarRental database from SQL Server
- Open SQL Server Management Studio
-
Right click the SofiaCarRental database. Choose Tasks->Generate Scripts.
-
Press Next on the first screen of the Wizard then choose the SofiaCarRental database and check the Script all objects and all database objects checkbox. Press Next.
-
You will need to edit the script by hand after it is generated, but, at the same time you can save some work by modifying some of the default script options. In the Set Scripting Options page, press the Advanced button. The following bullets specify the changes to the default options and the justification for doing so:
- Set Convert UDDTs to base types to True - SQL Azure does not support User Defined Data Types. You should use this option to convert any user-defined types into their underlying base types.
- Set Script extended properties to False - SQL Azure does not support extended properties. Therefore you do not need to script out these properties.
- Set Script USE DATABASE to False - SQL Azure does not support the USE DATABASE command for changing database context.
- Set Types of data to script to Schema and data - For the purposes of this lab, we want to script not only the database schema but also the data contained therein.
- After setting all the properties press Next.
- Leave the default Script to New Query Window radio button selected. Press Next.
- Press Finish.
-
You should see the progress dialog. Wait for this to complete and press Close.
To modify the exported script from SQL Server
In this task, you will edit the script that is generated by SQL Server in order to make it compatible with SQL Azure.
You can find a copy of the script that has already been edited according to the below instructions at the end of the topic.
- If it is not already open, open the script you created on the previous step.
-
If the first statement from the script matches the following one, delete it. This is because SQL Azure does not support Windows Authentication.
CREATE USER [NT AUTHORITY\NETWORK SERVICE] FOR LOGIN [NT AUTHORITY\NETWORK SERVICE] WITH DEFAULT_SCHEMA=[dbo] GO
-
At present, the script will be trying to create objects on a particular filegroup. You are not able to specify filegroups in SQL Azure. Press Ctrl-H to open the Find and Replace dialog again and this time Find: ON [PRIMARY] Replace with: . Press Replace All. It should find and replace 12 instances.
-
There are a number of options on indexes that are not supported as well. You will replace the WITH statement for various indexes. You are doing this to remove the options PAD_INDEX, ALLOW_ROW_LOCKS, ALLOW_PAGE_LOCKS. Press Ctrl-H to open the Find and Replace dialog. Find: WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) Replace with: WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF). Press Replace All. It should find and replace 6 instances.
Press Ctrl-S to save the progress to date.
-
Test your progress in preparing the script for SQL Azure. You will need to ensure that your query window has an active connection to SQL Azure and is connected to the SofiaCarRental database. If the connection has timed out you can press execute a couple of times and to be prompted for a login. Press the Parse button on the toolbar.
SQL Azure will now parse the query. This may take some time. The query should be parsed successfully.
- Now you are ready to execute the query. Press the Execute button on the toolbar.
-
Execute the following query to output the contents of the sys.objects system table. Ensure that all tables are imported.
SELECT * FROM sys.objects
SQL Azure Script for Populating the SofiaCarRental Database
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Employees](
[EmployeeID] [INT] IDENTITY(1,1) NOT NULL,
[EmployeeNumber] [NCHAR](5) NULL,
[FirstName] [varchar](32) NULL,
[LastName] [varchar](32) NOT NULL,
[FullName] AS (([LastName]+', ')+[FirstName]),
[Title] [varchar](80) NULL,
[HourlySalary] [smallmoney] NULL,
CONSTRAINT [PK_Employees] PRIMARY KEY CLUSTERED
(
[EmployeeID] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Employees] ON
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (1, N'88798', N'James', N'Robinson', N'janitor', 2.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (2, N'78965', N'John', N'Martinez', N'sales man', 7.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (3, N'14856', N'Robert', N'Garcia', N'sales man', 7.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (4, N'65823', N'Michael', N'Thompson', N'sales man', 7.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (5, N'13526', N'William', N'Martin', N'sales man', 7.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (6, N'25558', N'David', N'Harris', N'sales man', 7.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (7, N'69856', N'Richard', N'White', N'sales man', 7.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (8, N'14785', N'Charles', N'Jackson', N'manager', 9.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (9, N'13689', N'Joseph', N'Thomas', N'driver', 5.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (10, N'10585', N'Thomas', N'Anderson', N'driver', 5.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (11, N'45896', N'Christopher', N'Taylor', N'driver', 5.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (12, N'36985', N'Daniel', N'Moore', N'supervisor', 11.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (13, N'18745', N'Paul', N'Wilson', N'dealer', 12.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (14, N'12563', N'Mark', N'Miller', N'dealer', 12.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (15, N'85963', N'Donald', N'Davis', N'janitor', 2.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (16, N'15368', N'George', N'Brown', N'janitor', 2.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (17, N'69853', N'Kenneth', N'Jones', N'QA', 15.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (18, N'25478', N'Steven', N'Williams', N'chairman', 55.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (19, N'15789', N'Edward', N'Johnson', N'driver', 5.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName],
[LastName], [Title], [HourlySalary])
VALUES (20, N'87596', N'Brian', N'Smith', N'driver', 5.0000)
INSERT [dbo].[Employees] ([EmployeeID], [EmployeeNumber], [FirstName], [LastName], [Title], [HourlySalary])
VALUES (21, N'12126', N'Internet', N'Internet', N'Internet', 5.0000)
SET IDENTITY_INSERT [dbo].[Employees] OFF
/****** Object: Table [dbo].[Customers] Script Date: 11/08/2010 13:09:28 ******/
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Customers](
[CustomerID] [INT] IDENTITY(1,1) NOT NULL,
[DrvLicNumber] [varchar](50) NULL,
[FullName] [varchar](80) NULL,
[Address] [varchar](100) NOT NULL,
[Country] [varchar](100) NOT NULL,
[City] [varchar](50) NULL,
[State] [varchar](50) NULL,
[ZIPCode] [varchar](20) NULL,
CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED
(
[CustomerID] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Customers] ON
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (1, N'240-573-885', N'John Wattson', N'4024 Locktar Drive', N'USA',
N'Silver Spring', N'MD', N'20904')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (2, N'264-72-6663', N'Charles Calhoun', N'10630 Leila Rd #D4', N'USA',
N'Alexandria', N'VA', N'22231')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (3, N'802-46-4006', N'Jeannine Pons', N'802 Mimosa Road NW', N'USA',
N'Washington', N'DC', N'20006')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (4, N'264-72-6663', N'Charles Calhoun', N'10630 Leila Rd #D4', N'USA',
N'Alexandria', N'VA', N'22231')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (5, N'386-32-3456', N'Jarmein Defoe', N'Historic Road 66', N'USA',
N'Tuskegee', N'TS', N'34612')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (6, N'568-17-9875', N'James White', N'Minnehaha AND Hiawatha Avenue',
N'USA', N'Trussville', N'TR', N'22114')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (7, N'288-14-5423', N'William King', N'889 Lake D4', N'USA',
N'Southside', N'ST', N'20897')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (8, N'978-27-1145', N'Jeff Lewis', N'4451 Willow', N'USA', N'Smiths',
N'SM', N'20999')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (9, N'879-13-7798', N'Ronald Young', N'4412 Mill', N'USA',
N'Prichard', N'PR', N'22665')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (10, N'147-22-6663', N'Kevin Allen', N'19676 Lakeview', N'USA',
N'Guntersville', N'GR', N'22566')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (11, N'725-12-3498', N'Joseph Harris', N'55878 Broadway', N'USA',
N'Fort Payne', N'FP', N'22967')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (12, N'778-13-6871', N'Michael Smith', N'17896 Sycamore', N'USA',
N'Craig-Tyler', N'CT', N'22643')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (13, N'123-56-3567', N'Thomas Wilson', N'57878 Hillcrest', N'USA',
N'Attalla', N'AT', N'22123')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (14, N'546-61-1878', N'Anthony Moore', N'77485 Madison', N'USA',
N'Birmingham', N'BR', N'22309')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (15, N'745-66-9863', N'George Martinez', N'68598 Taylor', N'USA',
N'Chehalis', N'CH', N'22576')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (16, N'124-33-3568', N'Jason Baker', N'77748 Woodland', N'USA',
N'Everett', N'EV', N'22138')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (17, N'665-38-8745', N'Mark Hernandez', N'11478 Dogwood', N'USA',
N'Lake Stevens', N'LS', N'22265')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (18, N'453-32-8777', N'John Brown', N'88798 Spruce', N'USA',
N'Spokane', N'SP', N'22731')
INSERT [dbo].[Customers] ([CustomerID], [DrvLicNumber], [FullName],
[Address], [Country], [City], [State], [ZIPCode])
VALUES (19, N'489-89-1744', N'Whyne Rooney', N'74256 Franklin', N'USA',
N'Washougal', N'WS', N'22311')
SET IDENTITY_INSERT [dbo].[Customers] OFF
/****** Object: Table [dbo].[Categories] Script Date: 11/08/2010 13:09:28 ******/
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Categories](
[CategoryID] [INT] IDENTITY(1,1) NOT NULL,
[CategoryName] [varchar](50) NOT NULL,
[ImageFileName] [varchar](256) NULL,
CONSTRAINT [PK_Categories] PRIMARY KEY CLUSTERED
(
[CategoryID] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Categories] ON
INSERT [dbo].[Categories] ([CategoryID], [CategoryName], [ImageFileName])
VALUES (1, N'saloon', N'saloon.png')
INSERT [dbo].[Categories] ([CategoryID], [CategoryName], [ImageFileName])
VALUES (2, N'suv', N'suv.png')
INSERT [dbo].[Categories] ([CategoryID], [CategoryName], [ImageFileName])
VALUES (3, N'people carrier', N'peoplecarrier.png')
INSERT [dbo].[Categories] ([CategoryID], [CategoryName], [ImageFileName])
VALUES (4, N'hatchback', N'hatchback.png')
INSERT [dbo].[Categories] ([CategoryID], [CategoryName], [ImageFileName])
VALUES (5, N'limousine', N'limousine.png')
SET IDENTITY_INSERT [dbo].[Categories] OFF
/****** Object: Table [dbo].[Cars] Script Date: 11/08/2010 13:09:28 ******/
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Cars](
[CarID] [INT] IDENTITY(1,1) NOT NULL,
[TagNumber] [varchar](20) NULL,
[Make] [varchar](50) NULL,
[Model] [varchar](50) NOT NULL,
[CarYear] [SMALLINT] NULL,
[CategoryID] [INT] NULL,
[Mp3Player] [BIT] NULL,
[DVDPlayer] [BIT] NULL,
[AirConditioner] [BIT] NULL,
[ABS] [BIT] NULL,
[ASR] [BIT] NULL,
[Navigation] [BIT] NULL,
[Available] [BIT] NULL,
[Latitude] [FLOAT] NULL,
[Longitude] [FLOAT] NULL,
[ImageFileName] [varchar](256) NULL,
[Rating] [DECIMAL](9, 2) NULL,
[NumberOfRatings] [INT] NULL,
CONSTRAINT [PK_Car] PRIMARY KEY CLUSTERED
(
[CarID] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Cars] ON
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (1, N'PB 3341 SS', N'Opel', N'Corsa', 2004, 4, 1, 0, 1, 1, 0, 0, 1,
NULL, NULL, N'opel_corsa_2004.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (2, N'PB 3341 SS', N'Honda', N'Civic', 1993, 4, 1, 0, 0, 1, 0, 0, 1,
NULL, NULL, N'honda_civic_2006.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (3, N'PB 3341 SS', N'Hyundai', N'I30', 2008, 4, 0, 0, 0, 0, 0, 0, 1,
NULL, NULL, N'hyundai_i30_2008.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (4, N'PB 3341 SS', N'Audi', N'A3', 2003, 4, 1, 1, 1, 1, 0, 0, 0, NULL,
NULL, N'audi_a3_2003.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (5, N'PB 3341 SS', N'Mercedez', N'Aclass', 2007, 3, 1, 0, 1, 1, 0, 0,
1, NULL, NULL, N'mercedesbenz_aclass.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (6, N'PB 3341 SS', N'Mercedez', N'Bclass', 2007, 3, 1, 0, 1, 1, 0, 0,
1, NULL, NULL, N'mercedesbenz_bclass_lorinzer.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (7, N'PB 3341 SS', N'Alfaromeo', N'147', 2006, 1, 1, 1, 1, 0, 1, 1, 1,
NULL, NULL, N'alfaromeo_147_2006.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (8, N'PB 3341 SS', N'Volvo', N'c30', 2009, 1, 1, 0, 1, 1, 0, 0, 1,
NULL, NULL, N'volvo_c30_2009.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (9, N'PB 3341 SS', N'Lancia', N'Ypsilon', 2006, 4, 1, 0, 1, 1, 0, 0,
1, NULL, NULL, N'lancia_ypsilon_2006.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (10, N'PB 3341 SS', N'Honda', N'CR-Z', 2010, 1, 1, 0, 0, 1, 0, 0, 1,
NULL, NULL, N'honda_cr-z_2010.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (11, N'PB 3341 SS', N'Renault', N'Laguna', 2008, 1, 1, 0, 1, 1, 0, 0,
1, NULL, NULL, N'renault_laguna_2008.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (12, N'PB 3341 SS', N'VW', N'Golf', 2008, 4, 1, 1, 1, 1, 1, 1, 1,
NULL, NULL, N'vw_golf_2008.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (13, N'PB 3341 SS', N'Volvo', N'S60', 2010, 1, 1, 0, 1, 1, 0, 0, 1,
NULL, NULL, N'volvo_s60_2010.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (14, N'PB 3341 SS', N'Audi', N'A4', 2002, 1, 1, 0, 1, 1, 1, 1, 0,
NULL, NULL, N'audi_a4_2002.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (15, N'PB 3341 SS', N'BMW', N'535', 2006, 1, 1, 1, 1, 1, 1, 1, 1,
NULL, NULL, N'bmw_535d_2005.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (16, N'PB 3341 SS', N'BMW', N'320d', 2006, 1, 1, 1, 0, 0, 1, 1, 1,
NULL, NULL, N'bmw_320d_2006.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (17, N'PB 3341 SS', N'VW', N'Passat', 2005, 1, 0, 0, 0, 0, 0, 0, 1,
NULL, NULL, N'vw_passat_2005.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (18, N'PB 3341 SS', N'Peugeot', N'407', 2006, 1, 1, 0, 1, 1, 0, 0, 1,
NULL, NULL, N'peugeot_407_2006.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (19, N'PB 3341 SS', N'Opel', N'Vectra', 2008, 1, 1, 1, 1, 1, 1, 1, 1,
NULL, NULL, N'opel_vectra_2008.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (20, N'PB 3341 SS', N'Honda', N'Accord', 2008, 1, 1, 0, 0, 1, 0, 0, 1,
NULL, NULL, N'honda_accord_2008.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (21, N'PB 3341 SS', N'Alfaromeo', N'159', 2008, 4, 0, 0, 0, 1, 1, 1,
1, NULL, NULL, N'alfaromeo_159_2008.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (22, N'PB 3341 SS', N'Toyota', N'Corolla', 2007, 3, 1, 0, 1, 1, 0, 0,
1, NULL, NULL, N'toyota_corolla_spacio_2007.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (23, N'PB 3341 SS', N'Audi', N'Q7', 2007, 2, 1, 0, 1, 1, 0, 0, 1,
NULL, NULL, N'audi_Q7_2007.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (24, N'PB 3341 SS', N'Hyundai', N'Santafe', 2007, 2, 1, 0, 1, 1, 0, 0,
1, NULL, NULL, N'hyundai_santafe_2007.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (25, N'PB 3341 SS', N'Nissan', N'Qashaqi', 2007, 2, 1, 0, 1, 1, 0, 0,
1, NULL, NULL, N'nissan_qashqai_2008.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (26, N'PB 3341 SS', N'Toyota', N'Landcruiser', 2005, 2, 1, 0, 1, 1, 0,
0, 1, NULL, NULL, N'toyota_landcruiser100_2005.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (27, N'PB 3341 SS', N'Volvo', N'xc90', 2006, 2, 1, 0, 1, 1, 0, 0, 1,
NULL, NULL, N'volvo_xc90_2006.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (28, N'PB 3341 SS', N'VW', N'Touareg', 2010, 2, 1, 0, 1, 1, 0, 0, 1,
NULL, NULL, N'vw_touareg_2010.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (29, N'PB 3341 SS', N'VW', N'Touran', 2010, 3, 1, 0, 1, 1, 0, 0, 1,
NULL, NULL, N'vw_touran_2008.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (30, N'PB 3341 SS', N'Audi', N'A3', 2003, 4, 1, 1, 1, 1, 0, 0, 0,
NULL, NULL, N'audi_a3_2003.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (31, N'PB 3341 SS', N'Nissan', N'Almera', 2001, 1, 1, 0, 1, 1, 0, 0,
1, NULL, NULL, N'nissan_almera_2001.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (32, N'PB 3341 SS', N'BMW', N'x3', 2007, 2, 1, 1, 1, 1, 1, 1, 1, NULL,
NULL, N'bmw_x3_2007.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (33, N'PB 3341 SS', N'BMW', N'365', 2001, 1, 1, 1, 0, 0, 1, 1, 1,
NULL, NULL, N'bmw_535d_2005.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (34, N'PB 3341 SS', N'Lamborghini', N'Gallardo', 2008, 1, 1, 1, 1, 1,
1, 1, 1, NULL, NULL, N'lincoln_2011towncar_2010.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (35, N'PB 3341 SS', N'Alfaromeo', N'147', 2006, 4, 0, 0, 0, 1, 1, 1,
1, NULL, NULL, N'alfaromeo_147_2006.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (36, N'PB 3341 SS', N'Lincoln', N'TownCar', 2010, 1, 1, 0, 0, 1, 0, 0,
1, NULL, NULL, N'lincoln_2011towncar_2010.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (37, N'PB 3341 SS', N'Mitsubishi', N'Lancer', 2008, 1, 1, 0, 0, 1, 0,
0, 1, NULL, NULL, N'mitsubishi_lancer_2008.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (38, N'PB 3341 SS', N'Opel', N'Vectra', 2008, 1, 1, 0, 1, 1, 0, 0, 1,
NULL, NULL, N'opel_vectra_2008.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (39, N'PB 3341 SS', N'Toyota', N'Avensis', 2008, 1, 1, 0, 1, 1, 0, 0,
1, NULL, NULL, N'toyota_avensis_2008.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (40, N'PB 3341 SS', N'Chrysler', N'300', 2006, 5, 1, 0, 1, 1, 0, 0, 1,
NULL, NULL, N'chrysler_300_2006.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (41, N'PB 3341 SS', N'Mercedez', N'S600', 2009, 5, 1, 0, 1, 1, 0, 0,
1, NULL, NULL, N'mercedesbenz_S600_pullman_guard.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (42, N'PB 3341 SS', N'VW', N'Phaeton', 2005, 5, 1, 0, 1, 1, 0, 0, 1,
NULL, NULL, N'vw_phaeton_2005.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (43, N'PB 3341 SS', N'Citroen', N'Evasion', 1998, 3, 1, 0, 1, 1, 0, 0,
1, NULL, NULL, N'citroen_evasion_1998.jpg', NULL, 0)
INSERT [dbo].[Cars] ([CarID], [TagNumber], [Make], [Model], [CarYear],
[CategoryID], [Mp3Player], [DVDPlayer], [AirConditioner], [ABS], [ASR],
[Navigation], [Available], [Latitude], [Longitude], [ImageFileName],
[Rating], [NumberOfRatings])
VALUES (44, N'PB 3341 SS', N'Ford', N'Galaxy', 1998, 3, 1, 0, 1, 1, 0, 0, 1,
NULL, NULL, N'ford_galaxy_2008.jpg', NULL, 0)
SET IDENTITY_INSERT [dbo].[Cars] OFF
/****** Object: Table [dbo].[RentalRates] Script Date: 11/08/2010 13:09:28 ******/
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[RentalRates](
[RentalRateID] [INT] IDENTITY(1,1) NOT NULL,
[CategoryID] [INT] NULL,
[Daily] [smallmoney] NULL,
[Weekly] [smallmoney] NULL,
[Monthly] [smallmoney] NULL,
CONSTRAINT [PK_RentalRates] PRIMARY KEY CLUSTERED
(
[RentalRateID] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
SET IDENTITY_INSERT [dbo].[RentalRates] ON
INSERT [dbo].[RentalRates] ([RentalRateID], [CategoryID], [Daily], [Weekly], [Monthly])
VALUES (1, 2, 2.0000, 12.0000, 44.0000)
INSERT [dbo].[RentalRates] ([RentalRateID], [CategoryID], [Daily], [Weekly], [Monthly])
VALUES (2, 1, 1.0000, 6.0000, 22.0000)
INSERT [dbo].[RentalRates] ([RentalRateID], [CategoryID], [Daily], [Weekly], [Monthly])
VALUES (3, 4, 5.0000, 3.0000, 11.0000)
INSERT [dbo].[RentalRates] ([RentalRateID], [CategoryID], [Daily], [Weekly], [Monthly])
VALUES (4, 3, 1.0000, 9.0000, 33.0000)
INSERT [dbo].[RentalRates] ([RentalRateID], [CategoryID], [Daily], [Weekly], [Monthly])
VALUES (5, 5, 5.0000, 12.0000, 36.0000)
SET IDENTITY_INSERT [dbo].[RentalRates] OFF
/****** Object: Table [dbo].[RentalOrders] Script Date: 11/08/2010 13:09:28 ******/
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[RentalOrders](
[RentalOrderID] [INT] IDENTITY(1,1) NOT NULL,
[DateProcessed] [datetime] NULL,
[EmployeeID] [INT] NOT NULL,
[CustomerID] [INT] NOT NULL,
[CarID] [INT] NOT NULL,
[TankLevel] [varchar](40) NULL,
[MileageStart] [INT] NULL,
[MileageEnd] [INT] NULL,
[RentStartDate] [datetime] NULL,
[RentEndDate] [datetime] NULL,
[Days] AS (CONVERT([INT],[RentEndDate]-[RentStartDate],(0))),
[RateApplied] [money] NULL,
[OrderTotal] AS (CONVERT([money],[RateApplied]*CONVERT([INT],[RentEndDate]-[RentStartDate],(0)),(0))),
[OrderStatus] [varchar](50) NULL,
CONSTRAINT [PK_RentalOrder] PRIMARY KEY CLUSTERED
(
[RentalOrderID] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF)
)
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[RentalOrders] ON
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (1, CAST(0x000095E400000000 AS DateTime), 1, 1, 1, N'FULL', 100000,
102000, CAST(0x000095E500000000 AS DateTime),
CAST(0x000095EA00000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (2, CAST(0x00009B7200000000 AS DateTime), 2, 2, 2, N'FULL', 3500,
3700, CAST(0x0000973300000000 AS DateTime),
CAST(0x00009B7F00000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (3, CAST(0x000095B100000000 AS DateTime), 3, 3, 3, N'FULL', 310000,
310200, CAST(0x000095E500000000 AS DateTime),
CAST(0x000095EA00000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (4, CAST(0x0000944800000000 AS DateTime), 4, 4, 4, N'FULL', 250000,
250000, CAST(0x0000951A00000000 AS DateTime),
CAST(0x0000952200000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (5, CAST(0x0000989500000000 AS DateTime), 5, 5, 5, N'FULL', 250000,
260000, CAST(0x000097D500000000 AS DateTime),
CAST(0x000097DB00000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (6, CAST(0x00009A6200000000 AS DateTime), 5, 5, 5, N'FULL', 100000,
100012, CAST(0x000095E500000000 AS DateTime),
CAST(0x000095E800000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (7, CAST(0x00009B5200000000 AS DateTime), 5, 5, 5, N'FULL', 1000,
1050, CAST(0x000095E500000000 AS DateTime),
CAST(0x000095E800000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (8, CAST(0x00009B3300000000 AS DateTime), 6, 6, 6, N'FULL', 1000,
1070, CAST(0x000095E500000000 AS DateTime),
CAST(0x000095E800000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (9, CAST(0x00009B1500000000 AS DateTime), 7, 7, 7, N'FULL', 1000,
1560, CAST(0x000095E500000000 AS DateTime),
CAST(0x000095E800000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (10, CAST(0x00009AF600000000 AS DateTime), 8, 8, 8, N'FULL', 1000,
1300, CAST(0x000095E500000000 AS DateTime),
CAST(0x000095E800000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (11, CAST(0x00009AD700000000 AS DateTime), 9, 9, 9, N'FULL', 1000,
1287, CAST(0x000095E500000000 AS DateTime),
CAST(0x000095E800000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (12, CAST(0x00009AB900000000 AS DateTime), 10, 10, 10, N'FULL', 1000,
1388, CAST(0x000095E500000000 AS DateTime),
CAST(0x000095E800000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (13, CAST(0x00009A9800000000 AS DateTime), 11, 11, 11, N'FULL', 1000,
1458, CAST(0x000095E500000000 AS DateTime),
CAST(0x000095E800000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (14, CAST(0x00009A8300000000 AS DateTime), 12, 12, 12, N'FULL', 1000,
1658, CAST(0x000095E500000000 AS DateTime),
CAST(0x000095E800000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (15, CAST(0x00009A5F00000000 AS DateTime), 13, 13, 13, N'FULL', 1000,
1458, CAST(0x000095E500000000 AS DateTime),
CAST(0x000095E800000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (16, CAST(0x00009A4D00000000 AS DateTime), 14, 14, 14, N'FULL', 1000,
1689, CAST(0x000095E500000000 AS DateTime),
CAST(0x000095E800000000 AS DateTime), 1.0000, N'completed')
INSERT [dbo].[RentalOrders] ([RentalOrderID], [DateProcessed], [EmployeeID],
[CustomerID], [CarID], [TankLevel], [MileageStart], [MileageEnd],
[RentStartDate], [RentEndDate], [RateApplied], [OrderStatus])
VALUES (17, CAST(0x00009A2100000000 AS DateTime), 15, 15, 15, N'FULL', 1000,
1333, CAST(0x000095E500000000 AS DateTime),
CAST(0x000095E800000000 AS DateTime), 1.0000, N'completed')
SET IDENTITY_INSERT [dbo].[RentalOrders] OFF
/****** Object: Default [DF__Categorie__Image__060DEAE8] Script Date: 11/08/2010 13:09:28 ******/
ALTER TABLE [dbo].[Categories] ADD DEFAULT (NULL) FOR [ImageFileName]
GO
/****** Object: Default [DF__Cars__Latitude__7F60ED59] Script Date: 11/08/2010 13:09:28 ******/
ALTER TABLE [dbo].[Cars] ADD DEFAULT (NULL) FOR [Latitude]
GO
/****** Object: Default [DF__Cars__Longitude__00551192] Script Date: 11/08/2010 13:09:28 ******/
ALTER TABLE [dbo].[Cars] ADD DEFAULT (NULL) FOR [Longitude]
GO
/****** Object: Default [DF__Cars__ImageFileN__014935CB] Script Date: 11/08/2010 13:09:28 ******/
ALTER TABLE [dbo].[Cars] ADD DEFAULT (NULL) FOR [ImageFileName]
GO
/****** Object: Default [DF__Cars__Rating__023D5A04] Script Date: 11/08/2010 13:09:28 ******/
ALTER TABLE [dbo].[Cars] ADD DEFAULT (NULL) FOR [Rating]
GO
/****** Object: Default [DF__Cars__NumberOfRa__03317E3D] Script Date: 11/08/2010 13:09:28 ******/
ALTER TABLE [dbo].[Cars] ADD DEFAULT ((0)) FOR [NumberOfRatings]
GO
/****** Object: ForeignKey [FK_Categories] Script Date: 11/08/2010 13:09:28 ******/
ALTER TABLE [dbo].[Cars] WITH CHECK
ADD CONSTRAINT [FK_Categories] FOREIGN KEY([CategoryID])
REFERENCES [dbo].[Categories] ([CategoryID])
GO
ALTER TABLE [dbo].[Cars] CHECK CONSTRAINT [FK_Categories]
GO
/****** Object: ForeignKey [FK_RentalRateCategory] Script Date: 11/08/2010 13:09:28 ******/
ALTER TABLE [dbo].[RentalRates] WITH CHECK
ADD CONSTRAINT [FK_RentalRateCategory] FOREIGN KEY([CategoryID])
REFERENCES [dbo].[Categories] ([CategoryID])
GO
ALTER TABLE [dbo].[RentalRates] CHECK CONSTRAINT [FK_RentalRateCategory]
GO
/****** Object: ForeignKey [FK_Cars] Script Date: 11/08/2010 13:09:28 ******/
ALTER TABLE [dbo].[RentalOrders] WITH CHECK
ADD CONSTRAINT [FK_Cars] FOREIGN KEY([CarID])
REFERENCES [dbo].[Cars] ([CarID])
GO
ALTER TABLE [dbo].[RentalOrders] CHECK CONSTRAINT [FK_Cars]
GO
/****** Object: ForeignKey [FK_Customers] Script Date: 11/08/2010 13:09:28 ******/
ALTER TABLE [dbo].[RentalOrders] WITH CHECK
ADD CONSTRAINT [FK_Customers] FOREIGN KEY([CustomerID])
REFERENCES [dbo].[Customers] ([CustomerID])
GO
ALTER TABLE [dbo].[RentalOrders] CHECK CONSTRAINT [FK_Customers]
GO
/****** Object: ForeignKey [FK_Employees] Script Date: 11/08/2010 13:09:28 ******/
ALTER TABLE [dbo].[RentalOrders] WITH CHECK
ADD CONSTRAINT [FK_Employees] FOREIGN KEY([EmployeeID])
REFERENCES [dbo].[Employees] ([EmployeeID])
GO
ALTER TABLE [dbo].[RentalOrders] CHECK CONSTRAINT [FK_Employees]
GO