简体   繁体   English

如何使用VS2012 SSDT项目映射数据

[英]How to map data with VS2012 SSDT project

I am trying to investigate how to work with SSDT properly. 我正在尝试研究如何正确使用SSDT。 Currently I made publish working however I can not understand how to use this tool for development. 目前,我已完成发布工作,但是我不明白如何使用此工具进行开发。 What I mean is that I can change the code, but how to see the actual result? 我的意思是我可以更改代码,但是如何查看实际结果? I can add database to Object explorer and execute the statement, but how can I save it to the project after I made some changes? 我可以将数据库添加到对象资源管理器并执行该语句,但是进行一些更改后如何将其保存到项目中?

Typically the way I work with SSDT is to have a local database instance (Sql Express, Developer or LocalDb) and use that to push your changes to locally to test against and then when you are ready you can push your changes to the dev/test/prod server. 通常,我使用SSDT的方式是拥有一个本地数据库实例(Sql Express,Developer或LocalDb),并使用该实例将所做的更改推送到本地以进行测试,然后在准备好时将更改推送到dev / test / prod服务器。

To actually run the code you will need to deploy it to a sql server, ssdt basically gives you what a compiler would give you - to run the actual code you need sql. 要实际运行代码,您需要将其部署到sql服务器,ssdt基本上为您提供了编译器将为您提供的内容-运行所需的sql实际代码。

I would also investigate using tSQLt to write unit tests then you can push the project and the tests to your local instance and use that to check the data against the model. 我还将调查使用tSQLt编写单元测试的情况,然后您可以将项目和测试推送到本地实例,并使用它来对照模型检查数据。

When you are working in SSDT, the changes that you make are to model. 在SSDT中工作时,所做的更改将被建模。 You then need to deploy these changes by doing a diff using the schema compare. 然后,您需要通过使用模式比较进行差异来部署这些更改。 The schema compare will do a diff between the model and target and prepare an upgrade script for you. 模式比较将在模型和目标之间进行区分,并为您准备升级脚本。

Try hte following link: https://msdn.microsoft.com/en-us/library/dd193250(v=vs.100).aspx 请尝试以下链接: https ://msdn.microsoft.com/zh-cn/library/dd193250( v= vs.100).aspx

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM