visual paradigm two databases in same project - visual-paradigm

How can I have two databases in the same project in Visual Paradigm 10?
Right now I created two Entity Relationship Diagrams One for each database.
The problem is when I go to Tools > Database > Generate I can only select one specific database and both diagrams get applied to it.
I want each file to apply to it's own database.

Visual Paradigm can define multiple databases for the project (one for each DBMS), but any instance it will only pick one (the default one) for code/DDL generation. Within a project all models should be on the same database. I suggest you can send in your request to Visual Paradigm's support team (support#visual-paradigm.com) to discuss in details about your usage, and see how they can help.

Related

Compare code between two stored procedures in two different databases in SQL Server

There are two stored procedures which has same name and same logic. But in different databases. Only some of the content names are different (example - Synonym Name, Table Name, schema). Other code is the same.
Is there any way to compare code between above two stored procedures?
Personally i prefer to use a SSDT Project (SQL Server Data Tools)
It allows you to store the entire database schema in a Visual Studio project and in git/svn.
It is capable of comparing two databases (in full) or a database with the SSDT project schema. It will show you the differences and allow you to publish those differences.
Configurable and powerful.
I highly recommend it.
For many type of comparisons (folder, text, etc.) you can use Beyond Compare (they offers 30 days trial, but after it, you can simple reinstall it).
If you want something free, you can use a compare plugin for NotePad++ but is not so fancy as the first tool:
The Plugin Manager can be opened from Plugins -> Plugin Manager -> Show Plugin Manager.
I am using the file comparison tool 'Araxis Merge' to compare files in my project.
Please check the link to download the tool - http://www.araxis.com/merge/index.en
You can download the 30 days free trial version also.
Even though the source code for stored procedures can readily be retrieved from the database, they should really reside in a VCS for any database that is (or will be) productionised.
Historically, this has been something of a manual process but later versions of Visual Studio include the SQL Server Database Project type which makes development and deployment much easier.
The question then becomes the far easier one of how to compare files within the VCS which is typically trivial as this sort of thing is generally provided out of the box.
Aquastudio does it pretty well.

Database Schema To Another Database Schema Converter

Is there anyway that I could generate database from one schema to another?
For example, I would like to run my application from oracle to sql server or from sql server to postgresql?
I'm looking for something that's free....
Also I would like to know if there's a schema initializer to go with it
thanks a lot
The best tool I found so far is to use Squirrel's DBCOPY plugin. It really does the job
This doesn't really fall under the "free" category, but if you already have the tools (Microsoft Visual Studio and appropriate .NET providers), it might be a possibility.
The idea is to generate a data model from one database in Visual Studio and then use the Model First functionality to go from the conceptual model to another database. The steps would be something like this:
In a VS2010 application, add a new item to the project: ADO.NET Entity Data Model
Choose your existing database the source for this new model and select the desired tables and click through the wizard.
After the model is created, make sure the conceptual model is visible (.edmx file). In the properties for the model, there should be a DDL Generation Template option. Change this to the desired target type. This is the really iffy part; I don't know how many providers support this, but a quick search seemed to turn up at least one for Postgres.
Right click on the model and choose Generate Database from Model. This should produce the DDL for the new database.
This certainly would not lend itself well to an automated process, but for a one-time process, it might be okay.

Entity framework model creation

When using the Entity Framework there are basically two ways to create your model. You either create the model in SQL server or in Visual Studio EF designer. Those are outlined below.
Start with Database
You first create the model in your SQL server DB then point EF to create the .edmx file for you. By using this approach you can use SQL server management studio to create all of your models and relationships.
Start with Visual Studio EF Designer
This approach is to create the model first in Visual Studio and from that create your database. By doing this it seems like you don't have to be soo concerned with tables and relationships.
Here is what I do and why I do it that way
I start by creating my model using SQL server management studio. I do this because I think its easier to create and modify tables using that tool, also I know exactly what is being created. I create my EF model by pointing it to my existing database. After that I create a Visual Studio Database Project so that my database is scripted into files which I put into version control. When I need to make changes, I change the database and then update my .edmx file as well as my database project.
I was wondering what are the pros and cons to these different approaches and what should be the criteria to decide which to use? Am I doing it wrong? Should I be creating my model first in Visual Studio?
I don't think that there's a 'right' or 'wrong' way to do this, a lot depends on how you deploy your code, where it goes to etc. There is also a third way, which Scott Guthrie blogged about recently:
http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx
As a side note, even if you start with the model designer, I think you always have to think about your tables/relationships, as getting these wrong in the database can cause you big problems further down the line.
I don't think there is a right or wrong way.
At our company we are developing the database changes directly first, apply them to the edmx model for existing models.
For new models, we create the edmx model first, then generate the database. From that point on we usually update the database directly. After we have tested our code internally and it runs correctly, and we know that our SQL database is correct (and of course prior to checking in), we'll then apply the changes to the database project by doing a SQL compare on the database to the database project.
This has worked very well for us.

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??

Using MS Team System 2008 Database Edition

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.