locked
Deploy membership database to remote server. RRS feed

  • Question

  • Hi,

    I´ve built a ASP.Net website in vwd 2010. I use my own database (created in ssms 2008 r2) AND the membership database from microsoft (ASPNETDB.MDF). I´ve figured out that I choose "publish to provider" in vs2010, and then run the .sql file on the remote server database. This works with my database.

     

    However, microsoft´s database is giving me all sorts of trouble. As soon as you do anything with it, ssms corrupts it to the 661 version.

     

    This is what I need to do:

    Naturally, I have to be able to add users, roles and rules to the membership database when developing the website. I also need to be able to script BOTH databases to the remote server on a regular basis for the users to test. Therefor I would like to know how to do this without having to delete the ASPNETDB and create a new one in another project and then stopping sqlserver before I can move it to the correct project.

    I refuse to believe that microsoft has released the vs2010 (note 2010), with a membership template that sql server 2008 r2 destroys everytime you actually use it for what it is clearly intended for.

    So, please, how do I do it?

     

    I am aware that 2008 is not the same as 2008 r2, so no need to point that out.

     

    Thanks

    B. Santa

    Tuesday, April 19, 2011 2:07 PM

Answers

  • Hi Black Santa,

    Did you receive the error about database version? SQL Server maintains an internal database version and here are some SQL Server versions and their internal database versions:

    Internal Database Version,    SQL Server version
                    515,    'SQL Server 7.0' 
                    539,    'SQL Server 2000'
                    611,    'SQL Server 2005, VARDECIMAL disabled'
                    612,    'SQL Server 2005, VARDECIMAL enabled'
                    655,    'SQL Server 2008’
                    660,    'SQL Server 2008 R2'
    
    

    Please check the SQL Server version by running select @@version on both original server and target server. SQL server only supports backward compatibility. If the target version is lower than the original, then an error will occur. You can select the script for target database while publishing the original database.

    Please take a look at Using the Generate and Publish Scripts Wizard and SQL Database Publishing wizard is now in Visual Studio 2008.

    If I misunderstand you meaning, please feel free to let me know.


    Best Regards,
    Stephanie Lv

    • Marked as answer by WeiLin Qiao Thursday, April 28, 2011 11:25 AM
    Thursday, April 21, 2011 7:19 AM

All replies

  • Hi Black Santa,

    Did you receive the error about database version? SQL Server maintains an internal database version and here are some SQL Server versions and their internal database versions:

    Internal Database Version,    SQL Server version
                    515,    'SQL Server 7.0' 
                    539,    'SQL Server 2000'
                    611,    'SQL Server 2005, VARDECIMAL disabled'
                    612,    'SQL Server 2005, VARDECIMAL enabled'
                    655,    'SQL Server 2008’
                    660,    'SQL Server 2008 R2'
    
    

    Please check the SQL Server version by running select @@version on both original server and target server. SQL server only supports backward compatibility. If the target version is lower than the original, then an error will occur. You can select the script for target database while publishing the original database.

    Please take a look at Using the Generate and Publish Scripts Wizard and SQL Database Publishing wizard is now in Visual Studio 2008.

    If I misunderstand you meaning, please feel free to let me know.


    Best Regards,
    Stephanie Lv

    • Marked as answer by WeiLin Qiao Thursday, April 28, 2011 11:25 AM
    Thursday, April 21, 2011 7:19 AM
  • Hello Stephanie lv,

    Thanks for your reply, and forgive me for replying a bit late. I wasn't expecting an answer so soon. Glad I got it though!

     

    Yes, I recieve the error about the 661 version not being supported because it's higher than 655.

     

    Since I´m quite new to ASP programming and also quite new to the sql server, I was very glad to learn that microsoft provides everything you want as far as memberships and logins go, in the ASPNETDB.MDF database.

     

    However, as soon as you attach that database to the ssms 2008 r2, it gets upgraded to the r2 version, which means you can´t use it to add users and rolls etc anymore. The web administration interface cannot open its own database. Actually I attached it to the ssms mostly because I was curious about it, but in order to deploy it at the web host, I have to get it in the ssms and script it, right? So basically I need help on how to do that.

    Best regards

    Black Santa

    Thursday, April 28, 2011 9:16 PM
  • Hi,

    >>Yes, I recieve the error about the 661 version not being supported because it's higher than 655.

    Does the membership database (ASPNETDB.MDF) work fine at the original server, and the error occurs while you deploying the script to remote server, right?  The error message you received is the backward compatibility issue on SQL Server.  As mentioned above, check the versions on both the original and target servers and select a homologous version for target server on Script for target database property while you do the publish to provider.

    I recommend you take a look at Deploying a SQL Database to a Remote Hosting Environment.

    Please feel free to let me know if you have any question.


    Best Regards,
    Stephanie Lv

    Friday, April 29, 2011 1:43 AM