I'm developing a CMS and I'm using SQL Server with it. I want to automatically create my database in SQL Server 2008 when my app is installed.
I can generate a script. I'm wondering that there might be a way that I can install SQL script in a database using an MSI file.
e.g. in this link we can install database using a MSI file
http://www.microsoft.com/download/en/details.aspx?id=23654
I just wanna know how can we do it. Is it created using SQL Server or Visual Studio
you can attach a database through the app.config. in your installation you should copy this database to the right place.
Look here how to set your connection string:
http://www.connectionstrings.com/sql-server-2008
Related
I have an SSIS package that I am looking to save to a SQL Server database. In prior versions of Visual Studio, I had no issue doing this. I would go to:
File -> Save copy of package as
and it would give me the option to either save the package on the file system or to a SQL Server database.
Now the only option I get is to save to the file system.
How can I save to the SQL Server database again?
"Save Copy of Package as..." is only available if the SSIS Project is using the Package Deployment Model. By default, new project's use the Project Deployment Model.
To convert, right click on the Project and select "Convert to Package Deployment Model"
I need to automate SQL Server DB deployment using Azure DevOps. I don't want to give any alter statement. I will have a folder structure with tables, stored procedures, views & functions in repository. Every folder will contain only create scripts. Is there anyway to create DacPac file with that folder structure or any other way, other than DacPac deployment using that folder structure?
Note: I don't want to create DB project using Visual Studio. And I don't want to create a DacPac file directly from SQL Server Management Studio and checkin the same to source control. And I am not in a situation to pay for license.
You can try to use SQL Database Projects extension in Azure Data Sudio. It supports VS SQL Database Project and it supports builds from the command line: Build a database project from command line
What you describe is the database project. A dacpac is the build output of a Database project. There are no licenses involved. All the tools that produce dacpac files are free:
Both SQL Server Data Tools (SSDT) and SQL Server Management Studio (SSMS) are free, standalone downloads.
You can install SSDT on top of Visual Studio Community which is also free.
Azure Data Studio supports database projects. Also free, open source and works on Mac and Linux. I'm using it on Mac to edit database projects, using a SQL Server Developer Edition in a Docker container.
The sqlpackage command-line tool can extract a dacpac from an existing database, publish it or generate a migration script. Also free and a standalone download
I'm working on an Angular / .Net core project, and I want to deploy it on my homemade server equipped with Windows Server 2016.
I'm stuck at figuring out the best way to create my database from my migrations files. I've seen some topics on stackoverflow about it, but I don't want to make mistakes on my server, so I'm asking for the best way to do that.
The first option I think is to install Visual Studio IDE on my server. Then I can open my project and run an Update-database command, which will read all migrations files and create database.
But I don't think I'm supposed to install Visual Studio on a server...
The second option is something I saw on StackOverflow. In my development environment, I can use the command dotnet ef migrations script, which will generate a script.
But I'm not sure where I should put this script. I think probably in Microsoft SQL Server Management studio, New query and put my script.
Could you please tell me the best way ?
you need dotnet sdk in order to use dotnet ef migrations script but you can use your development pc to connect to your remote SQL Server and do migrations. for this, just point your connection string to remote SQL Server and use either Update-Database or dotnet ef update database
Another solution exists and You can use SQL server Generate Script to query all your database objects and execute it on target SQL server.
The best way you can do "first create" of your database in production environment is to Generate Script from SSMS (SQL Server Management Studio) and run that script on production Db server. The reason of that is because your database is empty (you can put all of data in script) and you can easily change the name, etc.
After that, on new versions of your application, the best way is to use Update-Database -Script and save/add that script to your deployment scripts.
When you are preparing for go-live, try that scripts with ROLLBACK TRANSACTION, if something fails...
I have created a program in C# which is connected with the database in SQL server as localhost. When I create setup file with instalShield, the program successfully installed, but it doesn't show the data from database and as such can not be used fully.
Can you help me what should I do to make a full setup.exe which can install everywhere including all files and database?
You can use from setup factory soft ware .
It's powerful for create setup.
http://download.cnet.com/Setup-Factory/3000-2216_4-10002374.html
How do I allow an SSIS package to consume a Visual Studio 2005 or 2008 Database project which houses the creation scripts for the tables and other objects (note: this is not Visual Studio Database Edition - just Pro with Business Intelligence)?
The idea is to use this to recreate my test instance by building the schema from source safe and the data from prod.
I have access to both VS2005 and 2008 Pro and this is hitting Sql Server 2005 for both Prod and Test.
The short answer is, you cannot "allow an ssis package to consume a VS 2005 or 2008 db project". I am not sure why you want to use SSIS to run the create scripts. You can run the scripts from sqlcmd utility.
If you still want to use SSIS, this is what I would do:
create a deployment script (VS for DB Pro can do that)
create a package
in your control flow, use Execute Process Task and configure it to run sqlcmd with the script file as your input
You can call the scripts in the DB project through Execute SQL tasks in the SSIS package. However, there's not a direct way to consume them.