Can I use Visual Studio project to keep database scripts ? - database

Is it possible to keep the all of my database scripts in VS? Is there an easy way or would I have to create the scripts from the database and manually add that file into my VS project?

Yes, in fact recent versions of Visual Studio have a type of project just for this - Database Projects
There's also SQL Server Database Tools (SSDT), which is kind of the same idea, but its own package if you don't have a version of VS that supports it on its own. I believe SSDT has been superseded by Database Projects in VS.

Related

Is it possible to design SSIS packaged without using some version of Visual Studio?

Due to company policies it's not allowed to have some kind of Visual Studio version. Is it possible to design SSIS packages without have some kind of Visual studio version?
In my opinion. And correct me if i'm wrong:
SQL Server : This need to have an SSIS instance and a SQL instance. SQL for storing data (not really necessary if you use a difference target) and SSIS for deploy the package to and schedule the refresh of the packages.
Managment Studio : Not really needed, but handy to maintain the database.
Tool to create the SSIS package. This can be achieve by:
install data tools : this comes with a Visual Studio shell
install Visual Studio Community : comes with the ability to open and create SSIS projected. It can be deployed from there
install Visual Studio Prof : comes with the ability to open and create SSIS projects. It can be deployed from there
Data tools is free to use can be used commercially
Managment Studio is free and can use used commercially
VS Community is free but can't be used commercially (not even in a pilot)
VS Prof is not free and can be used commercially
SQL Server is not free and can be used commercially
Have you considered not using SSIS? I was in similar scenario as and have migrated to using Windows services (top shelf) deployed with octopus deploy. It's more testable, better deployment experience and it's just c#...Maintenance is much easier. In terms of performance we process ETLs 5 time faster now too.
Answer of this question is yes ,We can create package using the SQL Server .
Go to the database >Right click on the database>task>Inport or Export>and then there is import Export wizard open to create.
I hope you guys got answer how we can create package without using the Visual Studio.

Can we create a project for oracle database deployment similar to visual studio SSDT project

I need a way to deploy the oracle database in a single click, something similar to SSDT projects.
Red Gate (where I work) has a set of deployment tools for Oracle, including version control, but they are not tightly integrated in Visual Studio. They were designed to be standalone as unlike for SQL Server, there are a handful of different IDEs in the Oracle scene, including Toad, SQL Developer and PL/SQL Developer.
The predecessor of SSDT had Oracle support via a Quest Extension, but this was discontinued with the release of SSDT.

How do Visual Studio 2013 Database Projects work with TFS online and EntityFramework code first migrations

Fairly long title, but hopefully self-explanatory!
I'm starting a new project in Visual Studio 2013 using Entity Framework 5.0 with code first migrations.
I've connected my project to TFS Online using git - I'm interested in trying TFS Online as it offers source control management for 5 free projects (similar to BitBucket) but with strong Visual Studio integration.
I've not used Database projects in Visual Studio 2013 and I've found little information for how this all fits together.
What I'm trying to acheive is to create a simple Visual Studio solution with 2 projects - one an MVC .NET project and the other a database project. My goal is that code first migrations will make the neccessary changes to the sql scripts in the database project (which are managed under git source control). My web.config points to a local .mdb file as my database which is what is updated when I run update-database in EF which is what I feel is the problem.
How can I point EF to use my database project for code migration, and subsequently how can I automatically build my development database into a local .mdb file when debugging my solution?
Entity Framework Code First is a way to manage your SQL Schema. The single source of the truth lives in your code base. Migrations adds a way to move from one version of the schema to another. The SQL schema is a by-product of the build process.
SQL Server Database projects are also a way to manage your SQL Schema. The single source of the truth lives in your SQL Server Database project. You can use schema compare to generate scripts that move from one version to another.
Given that these technologies overlap in their intent and functionality, it doesn't really make sense to use them together. When you're using entity Framework Code First, leverage Migrations when you can (and when the features are sufficient for your situation).
When you're unable to use Migrations, you could use SQL Server Database projects to manage the schema and keep them in source control.
Note:
You should consider installing the SQL Server Data Tools as a replacement for the SQL Server Database projects should you want to use these. The data tools are a more advanced version of these projects, even if they might require Visual Studio 2012 to run for now. I suspect a version for Visual Studio 2013 will be available when Visual Studio 2013 hits RTM

Setup and Deployement in VB.Net having Sql Server Database in the Project

I have completed my Project in VB.Net and has published my project.
But i want to come out of these things
I have Sql Server Database in my project and i want my setup to add that database to sql server on installing my project.
I want my application to automatically detect sql server 2008 r2 and if it is not instaled i want it to install for me and then atach the database.
I dont want to add the database as a Attached database in my project.
i dont want to install crystal report in my application.
I have some unused refernces in my application in my project which i want to removed, i have tried the default visual studio remove unused references but still have some references like shockwave.dll log2net.dll etc.
The first step would be to switch to an MSI-based installer. This should allow you to resolve issues 3 and 5 (you control what the MSI includes). You can use a Visual Studio setup project, WiX or a commercial setup authoring tool.
For installing your database (issue 1), the best approach depends on how you use your database. Some installers simply copy the database files, others install it using custom actions and others execute SQL scripts. You should first determine how you want to install it and then ask a more specific question if you encounter problems.
To install SQL Server when it's not found (issue 2), you can use a prerequisite. This is done differently for each setup tool, so you first need to decide on a tool and then research how it supports prerequisites.
For issue 4, I'm not sure I know what to say. An MSI package will install what you include in it. If you don't add Crystal Reports in your package, then it won't be installed.
Visit
http://www.codeproject.com/Articles/10032/Deploy-SQL-Server-databases-easily-with-an-Install
Deploy SQL Server databases easily with an Installer class
Best regards!
Elias Sant Anna

Embedding SQL Server into a .NET application

Hey, I've just finished writing a VB.NET application. Now I want to package the executable and the database ofcourse into a single installer file. I tried using QSetup, InstallShield to make SQL Server embedded into the setup file, and finally after hours of try&fail I have no idea. Anyone?
You can do a rightmouse on the properties of your Visual Studio Setup Project, and then there is this button 'Prerequisites'. There you can tick 'SQL Server Express ...' Or the 'SQL Server Compact 3.5'
link to image
You're probably best off just to set the connection file directly to the mdf, and attach it when the program is run. This is easier as it doesn't require a custom setup script to install the database to the database directory itself.
Note: Consider using the Compact Version, it's smaller, people don't like a full blown engine on their computer :)
InstallShield has a concept called Setup Prerequisites where you can teach it how to install additional packages along with your own. In older versions this would happen before calling your MSI. In newer versions you can have a "Feature" prerequisite where the prereq can associated to a feature and only installed if that feature is selected to be installed and after it's been selected but still before the main activity of your MSI occurs during the install execute sequence.
InstallShield also has a pattern for executing SQL scripts against your database instance so that you can then load your database into your newly installed instance.
All of this is quite powerful but it does take a bit of digging to learn.
As far as I know, anything but the SQL Server Compact Edition (SQL Server CE) cannot be embedded into your setup, really. Microsoft doesn't want that - you need to have SQL Server Express installed separately - any other edition can't even be shipped with your software (the client must have a license and installation separately).
You can indeed distribute SQL server with your custom application:
http://msdn.microsoft.com/en-us/library/bb264562(SQL.90).aspx

Resources