获取 ADO.NET 代码示例的示例数据库Get the sample databases for ADO.NET code samples

LINQ to SQLLINQ to SQL文档中的一些示例和演练 SQL Server 数据库和 SQL Server Express 的示例。A number of examples and walkthroughs in the LINQ to SQLLINQ to SQL documentation use sample SQL Server databases and SQL Server Express. 你可以从 Microsoft 免费下载这些产品。You can download these products free of charge from Microsoft.

获取用于 SQL Server 的 Northwind 示例数据库Get the Northwind sample database for SQL Server

从以下 GitHub instnwnd.sql存储库下载脚本,为 SQL Server 创建和加载 Northwind 示例数据库:Download the script instnwnd.sql from the following GitHub repository to create and load the Northwind sample database for SQL Server:

用于 Microsoft SQL Server 的 Northwind 和 pubs 示例数据库Northwind and pubs sample databases for Microsoft SQL Server

在您可以使用 Northwind 数据库之前,您必须运行下载instnwnd.sql的脚本文件以通过使用SQL Server Management Studio或类似的工具在 SQL Server 的实例上重新创建数据库。Before you can use the Northwind database, you have to run the downloaded instnwnd.sql script file to recreate the database on an instance of SQL Server by using SQL Server Management Studio or a similar tool. 按照存储库中的自述文件中的说明进行操作。Follow the instructions in the Readme file in the repository.

提示

如果正在寻找用于 Microsoft Access 的 Northwind 数据库,请参阅安装用于 Microsoft access 的 northwind 示例数据库If you're looking for the Northwind database for Microsoft Access, see Install the Northwind sample database for Microsoft Access.

获取 Microsoft Access 的 Northwind 示例数据库Get the Northwind sample database for Microsoft Access

Microsoft 下载中心不提供用于 Microsoft Access 的 Northwind 示例数据库。The Northwind sample database for Microsoft Access is not available on the Microsoft Download Center. 若要直接从 Access 中安装 Northwind,请执行以下操作:To install Northwind directly from within Access, do the following things:

  1. 打开访问。Open Access.

  2. 在 "搜索联机模板" 框中输入Northwind ,然后选择EnterEnter Northwind in the Search for Online Templates box, and then select Enter.

  3. 在结果屏幕上,选择 " Northwind"。On the results screen, select Northwind. 此时将打开一个新窗口,其中包含 Northwind 数据库的说明。A new window opens with a description of the Northwind database.

  4. 在新窗口中,在 "文件名" 文本框中提供 Northwind 数据库副本的文件名。In the new window, in the File Name text box, provide a filename for your copy of the Northwind database.

  5. 选择“创建”。Select Create. Access 会下载 Northwind 数据库并准备好文件。Access downloads the Northwind database and prepares the file.

  6. 此过程完成后,数据库将打开并显示欢迎屏幕。When this process is complete, the database opens with a Welcome screen.

获取用于 SQL Server 的 AdventureWorks 示例数据库Get the AdventureWorks sample database for SQL Server

从以下 GitHub 存储库下载适用于 SQL Server 的 AdventureWorks 示例数据库:Download the AdventureWorks sample database for SQL Server from the following GitHub repository:

AdventureWorks 示例数据库AdventureWorks sample databases

下载某个数据库备份(*.bak)文件后,使用 SQL Server Management Studio (SSMS)将备份还原到 SQL Server 的实例。After you download one of the database backup (*.bak) files, restore the backup to an instance of SQL Server by using SQL Server Management Studio (SSMS). 请参阅获取 SQL Server Management StudioSee Get SQL Server Management Studio.

获取 SQL Server Management StudioGet SQL Server Management Studio

如果要查看或修改已下载的数据库,可以使用 SQL Server Management Studio (SSMS)。If you want to view or modify a database that you've downloaded, you can use SQL Server Management Studio (SSMS). 从以下页面下载 SSMS:Download SSMS from the following page:

下载 SQL Server Management Studio (SSMS)Download SQL Server Management Studio (SSMS)

你还可以在 Visual Studio 集成开发环境(IDE)中查看和管理数据库。You can also view and manage databases in the Visual Studio integrated development environment (IDE). Visual Studio中,从SQL Server 对象资源管理器连接到数据库,或创建到服务器资源管理器中的数据库的数据连接。In Visual Studio, connect to the database from SQL Server Object Explorer, or create a Data Connection to the database in Server Explorer. 从 "视图" 菜单打开这些 "资源管理器" 窗格。Open these explorer panes from the View menu.

获取 SQL Server ExpressGet SQL Server Express

SQL Server Express 是免费的入门级版 SQL Server,可与应用程序一起分发。SQL Server Express is a free, entry-level edition of SQL Server that you can redistribute with applications. 从以下页面下载 SQL Server Express:Download SQL Server Express from the following page:

SQL Server Express 版本SQL Server Express Edition

如果你使用的是Visual studio,则 visual Studio 免费社区版以及专业版和更高版本中都包含 SQL Server Express LocalDB。If you're using Visual Studio, SQL Server Express LocalDB is included in the free Community edition of Visual Studio, as well as the Professional and higher editions.

请参阅See also