locked
What happens when you publish sql server to provider? RRS feed

  • Question

  • Hi,
    When you publish your database from visual studio, you create a .sql file, which is basically a command that you execute on the provider server, right?

    Now, since I'm a sort of beginner, and not always does the smartest things, I´ve uploaded my database (with membership database, so I´ve uploaded two databases), and used it with a client/customer.

    So, in the days to come I need to keep data in the database on the provider server, and only add data and tables etc. Not delete, and then add.

    So my question is:

    Does the script add to the database, or does it delete and then add?

    I´ve looked in the file obviously, but I don´t fully trust my knowledge of sql to gamble with this...

    thanks
    • Moved by Mark Liu-lxf Monday, October 22, 2012 7:14 AM (From:Visual Basic Express Edition)
    Friday, October 19, 2012 6:31 AM

Answers

  • It means existing objects will not be dropped.

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog

    • Marked as answer by Black Santa Saturday, April 6, 2013 7:13 AM
    Friday, October 26, 2012 11:53 AM

All replies

  • I would have to see the script to say for sure.  You can create sql file to create, modify, or delete tables or data.
    Sunday, October 21, 2012 5:03 PM
  • Hi Black,

    Welcome to the MSDN forum.

    This forum is for vb express edition issue.it seems that your issue has more relationship with SQL server.  For better support, I will move this thread to Transact-SQL forum. It will cost a little time to get the feedback from Microsoft. I appreciate your patience.

    Sorry for any inconvenience and have a nice day.


    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us

    Monday, October 22, 2012 7:14 AM
  • If you can post that script (or part of the script) we will be able to tell for sure. I suspect it drops and re-creates, but I've always used existing database, so I don't know.

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog

    Tuesday, October 23, 2012 2:53 AM
  • Please explain, what is the process you are following.

    You can create SQL script in VS in many different ways.

    Because this topic is moved from Visual Basic, I guess that you are using Entity Framework Code First.

    If it is the case, in .NET 4.5 you can create database migration scripts, please read: http://msdn.microsoft.com/en-us/data/jj591621

    Tuesday, October 23, 2012 5:07 AM
  • Thanks everyone for your help.

    I´m looking into the possibility to post the sql. There might be some data there that I´m not alllowed to share.

    I use the Database publishing wizard in visual studio, and now that I look carefully and not just take the default settings, there is one where I can choose "false" for "Drop existing objects in script". Is that what it means?And if I choose false, does it just add and maybe alter the posts?

    thanks

    Friday, October 26, 2012 7:48 AM
  • It means existing objects will not be dropped.

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog

    • Marked as answer by Black Santa Saturday, April 6, 2013 7:13 AM
    Friday, October 26, 2012 11:53 AM
  • Thanks again,

    I should´ve figured that one out myself I guess, but the thing is I´m in a little bit over my head with the sql server. And also the word "drop" is a little confusing in my language. (well that´s my excuse anyway)

    So if I don´t drop the objects, the operation checks the objects and data in the target db, and alters and add objects respectively?

    So if I have added columns in a table on my development machine, those columns will be added to the existing corresponding table withouth deleting any records?

    And does this all apply to the membership database aspnet.mdf, which I also script from development machine to public server?

    Thanks again.

    Friday, October 26, 2012 8:39 PM