Question

I have been trying to update the database when we deploy the application on the client's machine using sql queries. Now i want to update the database automatically. Is there any way to do this, i have heard of SQLMigrations but they say that it can only be used with Code first approach. Can anyone shed some light on this topic

Was it helpful?

Solution

You can use a Database Project in Visual Studio. With Database Projects, you can generate SQL Scripts for any existing database, you can create difference (update) scripts, you can add SQL scripts of your own, etc.

Database Projects are extremely handy in many scenarios. Check out this link on MSDN: http://msdn.microsoft.com/en-us/library/xee70aty.aspx

There is also guidance on CodeProject about this: http://www.codeproject.com/Articles/245612/Creating-a-Database-Project-with-Visual-Studio

You'll love it!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top