Using MS Team System 2008 Database Edition - sql-server-2005

I'm wanting to start source controlling our DBs. I've read a lot of questions here and have found that MS Team System 2008 with Database Edition is what I need. So we get it and we are kind of lost really.
We would like in first place, compare the different DBs we have (DEV, STA and PROD) because we had never done any source control on the DBs, they probably have some differences we would like to solve. I've read that MS Team System 2008 DB Edition could do it, but I think we are not finding how to.
Once we had every DB on the same "state", we would like to create some kind of plan to spread changes from local developers DB to some source control (I think putting the Database Project under SVN will do the job). And then have a way to generate the "change script" to propagate the changes to STA, and then to PROD of course. Any ideas of how to do this?
This probably has been already asked, but I guess I'm not finding anything because I'm not using the correct terms to search.
A link to another SO question or to some article describing how to work with MS Team System 2008 Database Edition and SQL Server 2005 projects will be very welcomed.
Thanks to all
Cheers

The answer to your first question is the schema and data comparison features of Visual Studio Team System - Database Developer. You should have a menu item between Build and Test called Data. Under that data menu are options like "Schema Compare" and "Data Compare" - they are fairly intuitive to use.
The next question is how to use the source control on the databases. Source control should be your one source of truth for schema. When you create your database projects and store them in source control, I would suggest having them mirror production initially. Then you can apply changes to the projects and compare the projects to target environments like dev/QA/prod to identify and script out differences that could be moved to those environments.
EDIT:
I would also highly recommend chapter 8 in the book "Professional Team Foundation Server". That chapter covers usage of Team Edition for Database Professionals for the purposes of managing schemas.

Related

FULL sql version-control using Team Foundation Server

Team Foundation Server version-control of Web Applications
I feel let down :( ...
Checking-in and out .mdf files, branching and merge all work well in TFVC, however there is no data conflict resolution (conflict resolution for code is great!), only a choice is offered between whole source or target files.
I am not suggesting that data-tables are displayed side-by-side, because scripts in DAC/ 'database projects' can be compared for changes in table structure and data differences compared by stored procedures.
Some method must be commonly used, but apparently that MS expect the code and data versioning to be managed iteratively/ separately? (I would like to avoid trialling additional proprietary software like Red-Gate Source-Control.)
FULL version control is required as new feature branches will change the DB, but core/testing data needs to be retained.
So PLEASE!! Help me with pointers to straight-forward FULL version-control practices for web applications that include sql versioning with intelligent merge and roll-back capabilities.
Many thanks!
You could try Red Gate Deployment Manager to manage your deployments, which also comes with a free community edition. However, although not strictly mandatory we would recommend that you do this in conjunction with SQL Source Control, which would allow you to specify static data tables to put in version control. Although this is third party software, the database objects are saved as plain text .sql files, and not a proprietary format.

Generate db diagram from any sql statement

I'm using DBArtisan 8.5.5 and it has the ability to generate Database Diagrams using Build Query, it has a nice feature that lets it autojoin, detecting potential relationships on newly added tables to the diagram. So the diagram results into a SQL statement since its a Query Builder after all.
Is it possible to provide an SQL statement in DBArtisan and generate the Database Diagram? In other words, the reverse (give it the SQL to generate the diagram, instead of using diagrams to generate SQL)?
If no such feature, is there a product out there for Sybase DB that will provide said feature?
DbVis is an actionable choice, being open source and powerful - it's got a good amount of extra features aside from the one you need.
If you're willing to pay, Aqua Data Studio is a very complete and intuitive database IDE.
As a middle ground solution, disposing of both a - constantly updated - open source edition, the DBeaver Open Source IDE, and an Enterprise Edition. Both of these also offer what you need, the main differences as of now being interface, SSH algorithm support and SQL debugging framework offered in Enterprise. You can take a deeper look yourself, comparing the Open Source features with the Enterprise ones.

Is there a tool that will show diagrams of my SQL database in real-time?

I've created some diagrams of SQL tables using the "Reverse Engineer" feature of Microsoft Office Visio. I like being able to visualize my relational databases in this manner.
However, what I get is just a static document that I can print, e-mail to colleagues, and click widgets on.
Earlier this year, I saw at a demo that the new version of Visual Studio 2010 has a new feature called the "Architect Explorer", which allows developers to view relationships among .net classes on the fly. It has many features for filtering the data that the developer is interested in.
It would be really awesome if I could visually browse my tables and stored procedures and see what is related to what by primary key, foreign key, and referenced in stored procedures. I realize that I'm talking about two entirely different technologies and it's not a perfect analogy, but is there some similar tool that would allow me to visualize tables in my SQL database?
I have seen RedGate SQL Dependency Tracker do this:
SQL Dependency Tracker allows you to dynamically explore all your database object dependencies, using a range of graphical layouts.
If you're already using Visio, you should be able to refresh your database diagrams after they've been reverse engineered from an existing database.
Check out:
About synchronizing database model diagrams with databases
If you have a database model that you
created from an existing database with
the Reverse Engineer W izard, you can
keep the drawing synch ronized with
the database.
Is that what you're looking for??

Database schemas WAY out of sync - need to get up to date without losing data

The problem: we have one application that has a portion which is used by a very small subset of the total users, and that part of the application is running off of a separate database as well. In a perfect world, the schemas of the two databases would be synced up, but such is not the case. Some migrations have been run on the smaller database, most haven't; and furthermore, there is nothing such as revision number to be able to easily identify which have and which haven't. We would like to solve this quandary for future projects. During a discussion we've come up with the following possible plan of action, and I am wondering if anyone knows of any project which has already solved this problem:
What we would like to do is create an empty database from the schema of the large fully-migrated database, and then move all of the data from the smaller non-migrated database into that empty one. If it makes things easier, it can probably be assumed for the sake of this problem specifically that no migrations have ever removed anything, only added.
Else, if there are other known solutions, I'd like to hear them as well.
You could use a schema comparison tool like Red-Gate's SQL Compare. You can synchronize the changes and not lose any data. I wrote about this and many alternative tools ranging widely in price here:
http://bertrandaaron.wordpress.com/2012/04/20/re-blog-the-cost-of-reinventing-the-wheel/
The nice thing is that most tools have trial versions. So, you can try them our for 14 days (fully functional) and only buy it if it meets your expectations. I can't speak for the other tools, but I've been using RG for years and it is a very capable and reliable tool.
(Updated 2012-06-23 to help prevent link-rot.)
Red-Gate's SQL Compare as Aaron Bertrand mentions in his answer is a very good option. However, if you are not permitted to purchase something, an option is to try something like:
1) For each database, script out all the tables, constraints, indexes, views, procedures, etc.
2) run a DIFF, and go through all the differences and make sure that the small DB can accept them. If not implement any changes (including data) necessary onto the small DB so it can accept the changes.
3) create a new empty database from the schema of the large DB
4) import the data from the small DB into the nee DB.
You could also reverse engineer your database into Visual Studio as a database project. Visual Studio Team Suite Database Edition GDR R2 (I know long name) has the capability to do a schema comparison and data comparison, but the beauty of this approach is that you get all of your database into a nice database project where you can manage change and integrate with source control. This would allow you to build from a common source and deploy consistent changes.

What is best tool to compare two SQL Server databases (schema and data)? [duplicate]

This question already has answers here:
What is a free tool to compare two SQL Server Databases? [closed]
(7 answers)
Closed 3 years ago.
I would like to compare two SQL Server databases including schema (table structure) and data in tables too. What is best tool to do this?
I use schema and data comparison functionality built into the latest version Microsoft Visual Studio 2015 Community Edition (Free) or Professional / Premium / Ultimate edition. Works like a charm!
http://channel9.msdn.com/Events/Visual-Studio/Launch-2013/VS108
Red-Gate's SQL data comparison tool is my second alternative:
(source: spaanjaars.com)
http://www.red-gate.com/products/sql-development/sql-compare/
http://www.red-gate.com/products/sql-development/sql-data-compare/
I like Open DBDiff.
While not the most complete tool, it works great, it's free, and it's very easy to use.
I am using Red-Gate's software:
http://www.red-gate.com
SQL Admin Studio from http://www.simego.com/Products/SQL-Admin-Studio is now free, lets you manage your SQL Database, SQL Compare and Synchronise, Data Compare and Synchronise and much more. Also supports SQL Azure and some MySQL Support too.
[UPDATE: Yes I am the Author of the above program, as it's now Free I just wanted to Share it with the community]
I'm partial to AdeptSQL. It's clean and intuitive and it DOESN'T have the one feature that scares the hell out of me on a lot of similar programs. One giant button that it you push it will automatically synchronize EVERYTHING without so much as a by-your-leave. If you want to sync the changes you have to do it yourself and I like that.
There is one tool with source code available at
http://www.codeproject.com/Articles/205011/SQL-Server-Database-Comparison-Tool
That should give flexibility as code is available.
dbghost is the best i have used to date. one of the best features i have seen is that it will generate SQL code to go between versions of a database based on the SQL you keep in source control, as well as a database. simple and easy to use.
I've used SQL Delta before (http://www.sqldelta.com/), it's really good. Not free however, not sure how prices compare to Red-Gates
Try DBComparer, it's free and fast:
http://dbcomparer.com/
Database Workbench can made it too
http://www.upscene.com/products.dbw.index.php
Cross database development
Use the Schema Compare and Migration
Tools to compare testing and deployed
databases, migrate existing databases
to different database systems.
you can also made it with database Comparer
http://www.clevercomponents.com/products/dbcomparer/dbcomparer.asp
I use it for Firebird and it works well.
Try dbForge Data Compare for SQL Server. It can compare and sync any databases, even very large ones. Quick, easy, always delivers a correct result.
Try it on your database and comment upon the product.
We can recommend you a reliable SQL comparison tool that offer 3 time’s faster comparison and synchronization of table data in your SQL Server databases. It's dbForge Data Compare for SQL Server and dbForge Schema Compare for SQL Server
Main advantages:
Speedier comparison and synchronization of large databases
Support of native SQL Server backups
Custom mapping of tables, columns, and schemas
Multiple options to tune your comparison and synchronization
Generating comparison and synchronization reports
Plus free 30-day trial and risk-free purchase with 30-day money back guarantee.
We are using an inhouse developed solution that is basicly a procedure with arguments of what you want included in the comparision (SP's, Full SP code, table structure, defaults, indices, triggers.. etc)
Depending on your needs and budget, it might be a good way to go for you as well.
It is quite easily developed as well, then we just redirect output of procedure to textfiles and do text comparisions between the files.
One good thing about it is that its possible to save the output in source control.
/B
I've used Red Gate's tools and they are superb.
However, if you can't spend any money you could try Open DBDiff to compare schemas.
I would definitely go with AdeptSQL if you're using MSSQL. It's the least good looking but the most talented db compare tool amongst the ones I've tried. It can compare both the structure and the data. It tells you which tables exist on one db but does not exist on the other, compares the structure and data of the common ones and it can produce the script to synchronize the two. It's not free but has a 30 day trial (as far as I can remember)
I tried OpenDiff Tool . Great tool that is free and easy to use .