Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/aws-samples/legacy-cycle-store-mvc-app/llms.txt

Use this file to discover all available pages before exploring further.

With your RDS instance running and its endpoint available from the CloudFormation stack output, the next step is to create the application database and populate it with the schema and seed data the Cycle Store app expects. All of this is handled by a single SQL script included in the project.

The SQL Script

The CYCLE_STORE_Schema_data.sql script performs every database-level setup step in one execution:
  1. Creates the CYCLE_STORE database — issues a CREATE DATABASE statement against the master database, then switches context to the new database.
  2. Creates the Production schema — all application tables live under this schema, keeping them logically separated from any future schemas you might add.
  3. Creates three tables — the core entities for the product catalog:
    • Production.ProductCategory — top-level categories (e.g., Bikes, Components, Clothing)
    • Production.ProductSubcategory — subcategories linked to a parent ProductCategory
    • Production.Product — individual products linked to a ProductSubcategory
  4. Inserts seed dataINSERT statements populate all three tables with realistic product records so the application has content to display immediately after setup.
The script opens with the following structure to bootstrap the database and schema:
USE [Master]
GO
CREATE DATABASE [CYCLE_STORE]
GO

USE [CYCLE_STORE]
GO
CREATE SCHEMA [Production]
GO
After the schema is created, the table definitions and data inserts follow within the CYCLE_STORE database context.

Connect with SSMS

Before opening SSMS, retrieve your password from AWS Secrets Manager so you have it ready to paste. In the AWS Console go to Secrets Manager → CycleStoreCredentials → Retrieve secret value, or run:
aws secretsmanager get-secret-value \
  --secret-id CycleStoreCredentials \
  --query SecretString \
  --output text \
  --region us-east-1
1

Open SQL Server Management Studio

Launch SSMS on your local machine. When the Connect to Server dialog appears, you are ready to fill in the connection details.
2

Enter the Server Name

In the Server name field, paste the SQLDatabaseEndpoint value from the CloudFormation stack outputs. It takes the form:
sqlrdsdb.xxxxxxxxxx.us-east-1.rds.amazonaws.com,1433
Note that SSMS uses a comma (,) before the port number rather than a colon.
3

Select SQL Server Authentication

Set Authentication to SQL Server Authentication. This is required because the RDS instance does not use Windows Authentication.
4

Enter Credentials

  • Login: DBUser
  • Password: the value retrieved from the CycleStoreCredentials Secrets Manager secret
5

Connect

Click Connect. SSMS establishes the connection and displays the Object Explorer panel showing the RDS server. At this point only the system databases (master, model, msdb, tempdb) are visible — the CYCLE_STORE database does not exist yet.

Run the Script

1

Open the SQL Script

In SSMS, go to File → Open → File and navigate to CYCLE_STORE_Schema_data.sql in the project repository. The script opens in a new query editor window. Confirm that the connection in the toolbar shows your RDS server name.
2

Execute the Script

Click Execute (or press F5). The script runs all statements in sequence: it creates the database, switches context, creates the schema, creates the tables, and inserts the seed records. Execution typically completes in a few seconds. Check the Messages pane at the bottom of the window — it should show a series of Command(s) completed successfully. lines with no errors.
3

Verify the Tables Exist

In the Object Explorer, expand Databases → CYCLE_STORE → Tables. You should see the three tables listed under the Production schema:
  • Production.Product
  • Production.ProductCategory
  • Production.ProductSubcategory
If the tree does not refresh automatically, right-click Tables and choose Refresh.

Verify the Data

Run the following queries in a new query window to confirm that seed data was loaded correctly into each table:
SELECT COUNT(*) FROM Production.ProductCategory;
SELECT COUNT(*) FROM Production.ProductSubcategory;
SELECT COUNT(*) FROM Production.Product;
All three queries should return a count greater than zero. A zero result for any table indicates that the INSERT portion of the script did not execute successfully — re-open the script, scroll to the relevant INSERT block, and run it again manually.

Build docs developers (and LLMs) love