Visual Studio 2012 数据库设计器 - 功能是否已更改? [英] Visual Studio 2012 Database Designer - Has the functionality changed?

查看:28
本文介绍了Visual Studio 2012 数据库设计器 - 功能是否已更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了 Visual Studio 和 SQL Server 2012.我想知道我是否遗漏了什么,因为数据库设计器似乎没有旧版本那么友好.

I recently installed Visual Studio and SQL Server 2012. I'm wondering if I'm missing something because the Database Designer doesn't seem anywhere as friendly as the old version.

在 Visual Studio 2010 中,当我在 App_Data 目录中创建 SQL 用户实例 (.mdf) 时,我能够使用与 SQL Server Management Studio 非常相似的漂亮界面来创建表.我会点击保存并更新所有内容.

In Visual Studio 2010 when I created a SQL User Instance (.mdf) in the App_Data directory, I was able to create tables using a nice interface that was quite similar to SQL Server Management Studio. I'd click save and everything was updated.

在新版本中:

1) 它似乎创建 .sql 脚本而不是自动保存我的更改

1) It seems to create .sql scripts instead of automatically saving my changes

2) 我必须在 TSQL 窗口而不是属性区域中更新某些内容(某些内容如表名在属性中显示为灰色)

2) I have to update certain things in the TSQL window instead of the Properties area (certain things like Table Name are greyed out in Properties)

3) 创建外键和索引之类的东西远没有以前那么简单了.

3) Creating things like Foreign Keys and Indexes is nowhere near as trivial as it used to be.

我的安装是否遗漏了什么?或者这是做事的新方式"?如果是这样,以我的拙见,为什么它变得更加复杂?

Am I missing something from my installation? Or is this the "new way" of doing things? If so, why has it been made, in my humble opinion, more complex?

推荐答案

SQL 用户实例设计器已替换为 SQL Server Data Tools (SSDT) 设计器.

The SQL User Instance designers have been replaced with SQL Server Data Tools (SSDT) designers.

这是因为 Microsoft 鼓励开发人员转向为数据库使用单独的 Visual Studio 项目,而不是将其作为资产存储在您的应用程序项目中.

Where this is going is that Microsoft is encouraging developers to move towards using a separate Visual Studio project for the database, rather than having it stored as an asset within your application project.

该项目系统的工作原理是在项目构建期间将一组离线数据库对象声明(用 T-SQL 编写)与物理数据库同步.

This project system works by synchronizing a set of Offline database object declarations (written in T-SQL) with a physical database during project build.

替换设计器看起来有点奇怪,因为它们继承了离线数据库项目中使用的设计器的大部分行为.

The replacement designers seem a bit peculiar because they inherit much of their behaviour from those designers used in the offline database projects.

您可以在此处阅读有关 SSDT 的更多信息:http://msdn.microsoft.com/en-us/library/hh272686(v=vs.103).aspx

You can read more about SSDT here: http://msdn.microsoft.com/en-us/library/hh272686(v=vs.103).aspx

当然,您没有理由不能使用那些在线设计器来编辑您的数据库:当您对对象进行更改时,不要点击保存,而是点击更新.这会将更改直接应用于您的 .mdf 资产.

Of course, there's no reason why you can't use those Online designers to edit your database: instead of clicking Save when you make changes to an object, click Update. This will apply changes directly to your .mdf asset.

或者也许按照我的方式做,然后简单地使用 SSMS 来编辑您的数据库 :)

Or perhaps do what I do and simply use SSMS to edit your databases instead :)

这篇关于Visual Studio 2012 数据库设计器 - 功能是否已更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆