Can I package SQL Server Express with my Visual Studio program deployment? - sql

I have created an application in Visual Studio that uses a .mdf database and executes SQL scripts on it. The program imports and exports reports to and from Excel. I want to be able to give this program to team members, but they get an error "error: 52 - Unable to locate a local database runtime installation. verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled."
I assume they get this error because they do not have SQL Server installed. Is there anyway I can include the minimum SQL Server components needed within my deployment? What is the minimum requirement? Thank you!

Related

Unexpected Termination when loading data from excel using ssis

I have SSIS package which simply loads data from excel using microsoft.ace.oledb. 12.0 driver to a sql server table.
The excel file size is 4.5mb
It is running fine locally.
When I delploy and run using Sql Server Agent in development enviroment, the job is failing with status 'Unexpected Termination'(after post validation and on information). I am not able to troubleshoot as there is no error message.
Please note development enviroment is exact image copy of my local.
This is only occurring for large excel files.
Make sure Microsoft Access Database Engine 2010 Redistributable https://www.microsoft.com/en-gb/download/details.aspx?id=13255 is installed on the server the SSIS package is running on so microsoft.ace.oledb. 12.0 is available. Be sure you choose the right version 64 vs 32 bit depending on how you run the package. Its probably x64 but unless you've explicitly set it to be x32.

Why does the SqlPublish target fail for a SQL Server 2014 database project?

My machine has the current (March 2014) version of SSDT, Visual Studio 2012 Professional, and SQL Server 2014 Developer. I have a SQL Server project (let's call it MyProject.sqlproj) that targets SQL Server 2014. I attempted the following:
MsBuild.exe MyProject.sqlproj
/t:SqlPublish /p:SqlPublishProfilePath=Somewhere.publish.xml
This fails with the following error:
Deploy error Deploy 72002: Internal Error.
The database platform service with type
Microsoft.Data.Tools.Schema.Sql.Sql120DatabaseSchemaProvider is not
valid. You must make sure the service is loaded, or you must provide
the full type name of a valid database platform service.
If I switch this project to target 2012 (and point to a 2012 instance), this same command runs successfully. I had previously asked a potentially related question, and the answer there resolved my problem then, but that's not the issue here -- I'm able to publish this 2014 DACPAC successfully if I use SqlPackage.exe directly.
What's happening, and how can I fix it?
The issue here is that the VisualStudioVersion environment variable isn't set, in which case the .sqlproj file currently defaults to targeting the VS2010 version (which does not support SQL Server 2014). Calling "set VisualStudioVersion=11.0" before running MSBuild will fix the issue.

How to determine where Load Test results are saved in Visual Studio 2010?

I'm running some load tests using Visual Studio 2010. I haven't been able to figure out how to set where the test results are saved, and it seems that I have no test results to browse once the test runs.
I have the general idea that you're supposed to supply a SQL connection string specifying a SQL server with some tables set up on it.
Where do I set the connection string for local test runs? Is it possible to configure VS2k10 to save my test results to a file locally?
Please note that local SQL databases such as SQL Express are specifically forbidden in my environment.
If you find yourself in a situation where you didn't setup the database to store the test results from the VS 2010 Load Tester, the following will help.
The default install of VS 2010, won't have the Microsoft Visual Studio Test Controller 2010 tool.
To create the necessary tables to store the test results, all you need to do is run the loadtestresultsrepository.sql script against your database.
You'll find this script at:
x86 - C:\Program Files\Microsoft Visual Studio 10\Common7\IDE
x64 - C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
Taken from:
MSDN: How to: Create a Load Test Results Repository Using SQL
Visual Studio strictly requires SQL Server for the load test store. If you don't have a SQL Server database, you cannot save test run data. All you can do is browse the result immediately after a test run, and perhaps copy-and-paste the test details into Excel. After you close the result, it's gone for good.
However, the database does not have to be on your local machine. Is there any chance you can get access to SQL Server somewhere else on your network?
You have to run "Microsoft Visual Studio Test Controller 2010 Configuration Tool" (found in Visual Studio start menu folder) to configure the database before use.
Setting the connection string is done in Test (menu) > Manage Test Controllers. This dialog allows you to select the Controller (or 'Local - No controller' for local tests) and also allows you to set the connection string to the load test results store.

Visual Studio error when trying to open dbproj files

I have Visual Studio 2008 Database Edition, and everything worked great until the first time I tried to load a .dbproj file. These database project files work for the other developers I work with, but when I try to open it, I just get an error message "Object reference ot set to an instance of an object."
It's probably the same problem this guy is having, although he didn't do a good job of describing it and has no solution.
Every other kind of project file loads and builds and runs normally. dbproj files all generate this cryptic error. I just tried a fresh removal and reinstall of Visual Studio 2008 DE to no avail. Could this have something to do with my SQL 2005 installation? (This also works normally through SQL Server Management Studio.)
**
UPDATE
**
Probably even more importantly, this same error occurs when I try to make a new dbproj file. Every other type of project can be created no problem.
You need to tell Visual Studio the correct instance of SQL Server to use for validation.
Tools>Options>DatabaseTools
Change the settings in "Data Connections" and "Design-time Validation Database" to reflect the correct instance.
After many failed re-configurations and re-installations, a member of my team discovered the problem!
Under Tools > Options > Database Tools > Design-time Validation Database, there is an option to set your SQL Server Instance Name. Visual Studio automatically picks this when it's installed.
The key is that Visual Studio doesn't necessarily pick the right one. I happen to have 3 SQL server instances on my machine. SQLEXPRESS (a 2005 instance that Visual Studio installed alongside itself), SQLEXPRESS2005, a 2005 instance I installed, and SQLEXPRESS2008, which I also installed.
Visual Studio had configured itself to connect to the SQLEXPRESS2008 instance, even though it only supports SQL2005 dbproj files by default. By opening this dialogue, and updating the server instance name, the error no longer appeared and I was able to open dbproj files:

How to get a changeset SQL query using DB Pro for .net and SQl Server when usinga Team build?

I am working on Build Automation via Team Build (TFS 2008). We are using DB Pro with our Web project.
I want to get the SQL script for database change-set ,(that has occurred till the nightly build), automatically using MSBuild Script . This script has to bundled in a zip file along with Web Application binaries and pages.
How can i automatically generate Database change-set(changes of tables and data that occurred since last change-set) in the form of a SQL script that can be executed any SQL Server database(SQL Sever 2000 or 2005 at the minimum).
kindly help.
Thanks.
The easiest way is to automate db deployment on specified database, and after that copy the created script to your package (if you're using VS 2008 DB Pro Edition)