ssms怎么导入sql文件_使用SSMS导入SQL数据库的BACPAC文件

本文介绍了如何使用SQL Server Management Studio(SSMS)导入BACPAC文件来刷新SQL数据库,包括导出BACPAC包,导入数据层应用程序向导,以及验证导入的数据库架构。
摘要由CSDN通过智能技术生成

ssms怎么导入sql文件

This article gives you an overview of BACPAC package and its usage in SQL Database data refresh (data import and export) using SQL Server management studio.

本文概述了BACPAC软件包及其在使用SQL Server Management StudioSQL数据库数据刷新(数据导入和导出)中的用法。

介绍 (Introduction)

Sometimes we get the requirement of refreshing few tales from other copies of the SQL Database. You can use various methods for this task as following:

有时我们需要从SQL数据库的其他副本中刷新一些故事。 您可以使用多种方法来完成此任务,如下所示:

  • Generate data script

    生成数据脚本
  • Data import and export wizard

    数据导入和导出向导

SQL Server does not support restoring individual tables from database backups. You can restore database backup with another database and import data from that database. For large databases, we cannot use this approach due to space and time constraints. You require space for storing the backup file as well as data and log files.

SQL Server不支持从数据库备份还原单个表。 您可以使用另一个数据库还原数据库备份,并从该数据库导入数据。 对于大型数据库,由于空间和时间限制,我们无法使用此方法。 您需要空间来存储备份文件以及数据和日志文件。

Another problem is the firewall issues. Many times, organizations do not allow firewalls between production and test environment. In this case, it becomes difficult to copy production data to lower the environment using a jump server using import and export wizards and backup methods as well. In this article, we will look at an alternative method of using a BACPAC package for refreshing tables.

另一个问题是防火墙问题。 很多时候,组织不允许在生产和测试环境之间使用防火墙。 在这种情况下,使用跳转服务器使用导入和导出向导以及备份方法来复制生产数据以降低环境变得困难。 在本文中,我们将介绍使用BACPAC包刷新表的另一种方法。

DACPAC和BACPAC封装概述 (Overview of a DACPAC and BACPAC package)

DACPAC is an acronym of Data-Tier Application Package. It is a logical database entity defining all database objects such as tables, views, users and logins. It enables developers and database administrators to create a single package file consisting of database objects. We call this package a DACPAC package.

DACPAC是d ATA-层的首字母缩写 PPLIÇ通货膨胀的Pac卡格。 它是一个逻辑数据库实体,定义了所有数据库对象,例如表,视图,用户和登录名。 它使开发人员和数据库管理员可以创建由数据库对象组成的单个程序包文件。 我们将此程序包称为DACPAC程序包。

Usually, developers use SQL Server Data Tools (SSDT) for writing t-SQL scripts and making changes as per the requirement. They can generate a DACPAC package and send it to DBAs for deploying in multiple environments. Similarly, DBA can give the DACPAC copy of a production database to developers for their development purpose.

通常,开发人员使用SQL Server数据工具(SSDT)编写t-SQL脚本并根据需要进行更改。 他们可以生成DACPAC软件包并将其发送给DBA,以在多个环境中进行部署。 同样,DBA可以将生产数据库的DACPAC副本提供给开发人员以用于其开发目的。

We can also use DACPAC packages for schema comparison as well between different copies of it. You can use the Azure Data Studio SQL Server Schema Compare extension for this.

我们还可以使用DACPAC软件包进行模式比较,以及在其不同副本之间进行模式比较。 您可以为此使用Azure Data Studio SQL Server架构比较扩展

Similarly, BACPAC ( Backup package) consists of schema and data for SQL Server tables. We can export database tables in a BACPAC package and give it to developers for refreshing data per their convenience.

同样,BACPAC( Bac kup pac kage)由SQL Server表的架构和数据组成。 我们可以将数据库表导出为BACPAC包,并提供给开发人员以方便他们刷新数据。

We get options for DACPAC and BACPAC package in SSMS.

我们在SSMS中获得DACPAC和BACPA

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值