2

I read this thread and have one more questions related to that How to make live changes to SQL server express

If I'm going to do as the marked right answerer. I'm going in to the server in management studio and to this

CREATE TABLE <table name> ( 
    <attribute name 1> <data type 1>,
    ...
    <attribute name n> <data type n>);

I know how to do it but i be more comfortable if it was the database on my computer and then i could upload it and merge it somehow.

so to my question: is it possible to work on the database on my computer and then upload it on the server and merge it with the live one and don't lose any data?

Community
  • 1
  • 1
Madde Persson
  • 413
  • 1
  • 6
  • 26

2 Answers2

1

You can do that easily. When you're finished testing locally and happy with the results just export the table you created earlier (with or without data) to a text file. That file will contain the necessary SQL queries to create the table again using the same field names and types and optionally insert all date you added locally. Run those queries on your live server and that's it!

Dominique
  • 1,080
  • 14
  • 29
  • 1
    My pleasure! Just have a look at a table export with any text viewer and you'll notice how simple it is. It's nothing more than SQL queries recreating the exact same situation... which is what you'd expect when restoring a backup. FYI: viewing SQL exports can be too much for notepad, you might want to consider notepad2 or notepad++ (whichever you prefer, I have both) when you're working on large databases. – Dominique Oct 29 '14 at 10:41
  • i have done this but the whole database, now i see i can select tables, thanks again – Madde Persson Oct 29 '14 at 10:49
0

I assume that your local database is on a local instance of MSSQL. One way of achieving this is by using another tool for syncing you local database with the one on the server. Personally I use the following tools from RedGate: SQL Compare for the database structure and SQL Data Compare for the content of the database. These tools can also generate T-SQL scripts. You can use those when deploying to other environments (Ex. test, acceptance, production).

Paul Lucaciu
  • 134
  • 3