Using WebDeploy to deploy database updates - database

We have adopted WebDeploy for a new project and it seems to handle the deployment of our apps to our Dev and Test servers pretty well.
Now we would like to extend the use of WebDeploy to make it deploy database changes too.
Scott Gu's blogpost on webdeploy states:
Web Deploy enables you to not only
publish files – but also provision
database schema/data, run database
change scripts, set security ACLs, and
more
... but I can't find any good information on how to run database change scripts with
WebDeploy.
Does anyone have guidance, advice, best-practice or informative links for this?
Thanks
Darren.

If you're using Visual Studio 2010 or Visual Studio 2010 Express then you can specify database change scripts in the Package/Publish SQL tab in your project's properties. For more information see the following article:
How to: Deploy a Database With a Web Application Project

Related

How to work in SQL Server as a team?

Me and my team are developing a SQL Server database. We want to work on different PCs, but with the same database. Is it possible that we can synchronise our work on each PC, or share our database while working somehow?
If possible how can Team Foundation server be used for that?
You can use SQL Server Database Tools (SSDT) to represent your database as a series of scripts. These scripts can then be added to source control. Git is by far the most popular source control system there is and Team Foundation Server and Visual Studio Team Services have great Git support.
Each developer will use Visual Studio (or VS Code) on their own machine to do their database work. When the developer wants to share their changes, they commit them to source control. Other developers can then update their local version of the code with the new changes. SSDT adds support for bringing your database and database project in sync.
Now that your code is in source control you can go a step further and add things like continuous integration builds and automated deployments with VSTS Build and Release Management. That way you can automatically test database changes and even run unit and integration tests before deploying to test and production environments.
The following Channel9 video gives an introduction to these tools: Database Continuous Integration and Deployment with Visual Studio SQL Server Data Tools in < 10 minutes
If you only care about schema changes (and not data changes), you can use visual studio's SQL Server projects, and a source control system, to help manage this. You can then use the Schema Compare tool to compare your project to the server, the server to your project, or server to server.
There are some tools from the likes of Redgate, etc, that allow this process to be automated. I've not used those, but they may be another option.

Installation project dynamic connection string

I have a windows forms application, that i want to deploy as installation project using visual studio 2010.
I am using SQLite database and i want to create a connection string while the installation to the installation directory.
On the other hand, i do not know should i attach my empty database to the install project or i have to create it while the installation?
I found lot of web sites, but none of them helped.
Thank you in advance all the help and please refer helper links in this topic.
Here is a tutorial which can get you started:
http://support.microsoft.com/kb/307353
Visual Studio is very limited when it comes to the setup project features. It doesn't support SQL connections, so you can do it only through a custom action.
If you need advanced features (like an SQL connection), I recommend a different setup tool:
http://en.wikipedia.org/wiki/List_of_installation_software

Create database and add data during application installation

I have developed a windows form application. I have also created a database on sql server and added data to this database.
Now i want to install this application at clients place. I want to know the ways to move my created database on client's location. How can i do this during application installation? If i have to include database scripts in installation file and run it.how can i do it? If its a long process please specify links which helps me in accomplishing this task.
Thankyou very much.
Look at the GDR R2 database project (part of Visual Studio).
You can use this to reverese engineer your existing database into scripts within a Database project, and place under source code control. You can synchronise existing and deploy fresh databases from this project.
Visual Studio 2010 SQL Server Database Projects
An Overview of Database Build and Deployment
Visual Studio Database Guide
You can also use commercial tools such as those sold by RedGate.

How to build a specialized installer in VS2010?

I'm looking to build a specialized msi installer, preferably with VS2010 to do the following:
Be able to configure SQL server connection.
Pick the database to be used from the SQl server.
Create database table with specified credentials.
Assign a new DB user a set of permissions.
Also configure the IIS application.
I looked into a default installer project in VS2010 and it has nothing related to dealing with SQL server and IIS. Any idea how can I do all this?
Visual Studio setup projects do not offer support for SQL scripts and IIS. The best you can do is write some custom actions (using custom code) to handle this during install.
Commercial setup authoring tools offer the most control over SQL scripts and IIS elements. You can find a list here: http://en.wikipedia.org/wiki/List_of_installation_software
You can also try WiX. It has a steep learning curve, but it's free and gets the job done.

Lightswitch prerequisites on ASP.NET webserver

I am trying to deploy a LightSwitch application to a hosted ASP.NET webserver in my company. The application access data stored on a SQL Server. My webserver admin is asking me if there are any special prerequisites needed for it to run. I've been reviewing the deployment guide
http://blogs.msdn.com/b/bethmassi/archive/2010/09/23/configuring-a-machine-to-host-a-3-tier-lightswitch-application.aspx
The article lists that there was a server component, but that it might change when RTM arrived:
NOTE: The team is looking at simplifying this process and possibly making the LightSwitch server component pre-reqs go away so this process will likely change for RTM.
This other MSDN article states that there are prerequisites.
http://msdn.microsoft.com/en-us/library/gg481779.aspx
My webserver admin keeps saying there's nothing to install on the ASP.NET web server other than .NET 4.0.
Am I missing something?
Server setup procedures haven't changed since Beta 1 (although of course the runtime has changed). It's pretty simple; the prerequisites article that you cited has the correct information. Basically the process is:
Install the Web Platform Installer if you don't already have it installed
Fire up the WPI and search for the LightSwitch runtime
Install!
As mentioned in the article, you'll need to decide whether you want to install a new instance of SQL Server locally with the prerequisites. If you've already planned for a production SQL Server, you'll want to choose the "without local SQL" option.
I don't have a specific answer, but I would stand up a VM with the appropriate version of windows server on it and run through an install on a do novo machine. Should confirm or deny what your server admin says . . .

Resources