Recreate local copy of sql server database for server

I have a database that is stored locally on my desktop computer. I’ve made many changes since the original SQL Script and in hindsight I should have kept a record of the changes.

Now I want to recreate this database on a server. Is there any way I can generate a script that will allow me to create the database with it’s contents on the server?

  • Input string was not in a correct format.‎
  • SQL Server: String Manipulation, Unpivoting
  • DB column extract and split to find other table result
  • SQL-select top 3 values per group WITH CONDITION
  • SQL query with condition
  • How to find values in all caps in SQL Server?
  • Thanks

    3 Solutions collect form web for “Recreate local copy of sql server database for server”

    You could backup the database, copy the .bak file to the server and then restore it there.

    If all you need is your local DB on the server, just backup and restore your local DB on the server.

    But I’m guessing that you’ve made schema changes and / or static data changes which need to be propogated over the server, since you need to retain interim data on the server.

    Schema changes can be found using a tool such as Redgate SQL Compare or VS DBpro, scripted, and run on the server.

    Get yourself a SQL compare tool that will replicate the changes on the server.

    This post might be useful as a reference to other potential tools:
    Is there an open source SQL Server DB compare tool?

    Or you can create a database backup and restore it on the server, if downtime doesn’t matter. This can cause problems sometimes with logins etc, but it’s not too much hassle.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.