Deploying an ASP.Net MVC Application

I recently reached the stage at which an ASP.NET MVC application is being developed, ready for deployment on a production server. I developed how to publish the application - I have all the files on the server and you can access them via the Internet.

However, I cannot decide how to deploy my database. SQL Server Management Studio Express is installed on the server because the database is a SQL Server Express database. I have a server instance and it works - I just don't know how to add tables, etc. To the database.

I created the “CREATE TABLE” scripts on the development machine, but as far as I can see, Management Studio provides no way to actually run these scripts. I looked through all the menu items that I could see, and none of them worked. Even using the option "Create a new request ..." and pasting the script inside did not work.

When I try "File-> Open ..." and select a script to run, install the correct database from the drop-down list on the toolbar, and then run the script, it complains that it did not find the database file (even if I installed the statement USE [...]on the right way.

Removing the statement USE [...], the script complains that it cannot find the object [dbo].[Invoices]; however, he cannot find it, because he is trying to create it!

tl; dr : What is the best way to make sure the database on the working machine matches the database on my development machine?

EDIT: One of the scripts is online here . The result (after deleting the first two lines) is here .

+3
source share
2 answers

The data type DATEwas added in SQL Server 2008. Presumably, your production server only works with SQL Server 2005, which is why you get "Column, parameter or variable # 2: Cannot find the date of the data type." error.

You will need to change the data type to DATETIME(which is supported in SQL Server 2005).

+2

? , dev macine, . , , , , . , , script? script ?

0

Source: https://habr.com/ru/post/1747792/


All Articles