Sql 具有本地化的数据库模式

Sql 具有本地化的数据库模式,sql,sql-server,Sql,Sql Server,我正在创建一个带有本地化和SQL表的应用程序 我想知道应该使用哪种方法来创建表 选择1 一个表发布公共数据,另一个表发布每个区域性的本地化数据 create table dbo.Posts ( Id int identity not null, Created datetime not null ); create table dbo.Posts_Localized ( Id int not null, [Culture] int not null constrain

我正在创建一个带有本地化和SQL表的应用程序

我想知道应该使用哪种方法来创建表

选择1

一个表发布公共数据,另一个表发布每个区域性的本地化数据

create table dbo.Posts
(
  Id int identity not null,
  Created datetime not null
);

create table dbo.Posts_Localized
(
  Id int not null,
  [Culture] int not null 
    constraint CK_Culture check ([Culture] in ('1', '2', '3')), // EN, FR, DE
  Title nvarchar (200) not null
);
选择2

一个表发布所有数据。。。每条记录都有一个键

版本EN、PT、FR将共享一个密钥,因为同一帖子的版本不同

create table dbo.Posts
(
  Id int identity not null,
  Created datetime not null,
  [Culture] int not null 
    constraint CK_Culture check ([Culture] in ('1', '2', '3')), // EN, FR, DE
  Title nvarchar (200) not null,
  [Key] uniqueidentifier not null
);
我认为第二种方法有好处,因为:

将有更少的加入

如果我决定一个列可能会从公共变为非公共,我就不需要更改数据库模式

你觉得怎么样

谢谢,,
Miguel

如果你有更多的表,那么你应该使用第一种方法,因为它将是标准化形式,否则第二种方法很好。我有帖子和许多其他表:帖子和帖子本地化,幻灯片和幻灯片本地化,产品和产品本地化。。。你是说我应该使用选项2,因为我有很多表?也许我不明白你的答案…如果你想通过与这个表和其他表执行连接来获取数据,那么你应该使用第一种方法,否则第二种方法就好了。我希望你了解DBMS中的规范化。是的,我确实想用这个表和其他表获取数据。。。例如,Posts表可以与Tags表具有NxN关系。。。或者,Posts\u可以与Files表有一个NxN关系……所以最好使用选项1