简体   繁体   English

如何将数据库中的表架构与C#中的sql脚本文件进行比较?

[英]How to compare table schema on a database with an sql script file in C#?

Let say I have a table name Anonymous on a database and I have a file name Anonymous.sql on my harddrive. 假设我在数据库上有一个表名Anonymous ,而我的硬盘上有一个文件名Anonymous.sql I want to know if the table's schema is as same as or difference from the schema define in Anonymous.sql . 我想知道表的架构是否与Anonymous.sql定义的架构相同或不同。 The sql file has a CREATE schema. sql文件具有CREATE模式。

My questions are: 我的问题是:

  1. How to compare a table's schema with a schema in an sql file? 如何比较表的模式与SQL文件模式?
  2. If they have any difference, how can I alter the table on the database? 如果他们有什么区别,我怎样才能改变数据库的表?

If your table schema is in sql file, you can you beyond comparer software to compare those files. 如果您的表模式在sql文件中,则可以使用比较器软件之外的工具来比较那些文件。

And if you have any changes, change with that software and rerun the table schema in sql server with the prefix "alter table name" 并且,如果有任何更改,请使用该软件进行更改,然后在SQL Server中使用前缀“ alter table name”重新运行表架构。

for software download 用于软件下载

http://beyond-compare.en.softonic.com/ http://beyond-compare.en.softonic.com/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL数据库列表和更新中的C#自动架构比较 - C# Automatic Schema Compare on list of SQL Database and Update 在 C# Z2D50972FECD376129545507F1062089Z 或 .netcore 中以编程方式比较 sql 数据库架构的方法 - Ways to compare sql database schema programmaticall in C# .net or .netcore SQL Server-使用C#将“创建表” SQL脚本与表定义进行比较 - SQL Server - Compare a 'CREATE TABLE' SQL script to a table definition using c# 如何使用C#中具有相同列的Excel比较数据库表? - How to compare database table with excel with same columns in c#? 在C#中运行SQL脚本到某个数据库或表? - Run an SQL script to a certain Database or Table in C#? 如何使用C#比较SQL Server中的两个表列 - How to compare two table columns in sql server using c# 将C#中的列表与数据库中的表进行比较 - Compare a list in C# to a table in a database 通过C#传递数据库名称来运行Sql脚本文件 - Run Sql Script File With Passing database name from C# 如何将输入文件中的行分为两部分,然后将其与c#中数据库表的两列数据进行比较? - How can I divide line from input file in two parts and then compare it to the two column data of database table in c#? 如何解析 C# 中的通用 XML 文件以在 SQL 服务器数据库中创建表 - How to parse a Generic XML File in C# to create a Table in SQL Server database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM