locked
Change LS Default SQL Server? RRS feed

  • Question

  • Is it possible to change the LS default SQL server location from the local machine to SQL Server instance? If so where do you make that selection?

    Regards,


    Ken Carter

    • Moved by Jiayi Li Wednesday, October 7, 2015 2:07 AM
    Tuesday, October 6, 2015 2:14 PM

Answers

  • The only time these rules would hamper the use of LS is when the specific data being managed by the application was not being stored on separate SQL server and the data was considered business critical data.


    Then there is no problem. 

    We're talking about the same thing, but maybe you're missing the fact that the only the development db is local and it never contains production data.

    So, assuming you don't enter sensitive data during debug, such data will always and only exist on the server to which you publish the production application. 

    The internal\external discussion is only about development - if LS is responsible for schema changes then it's internal else schema changes happen externally. 

    In both cases the deployed app connects to any SQL Server you specify - in that way all prod apps use a SQL server that is 'external' to the application.

    Typically the most common type of IT policy that prevents folks from going intrinsic is when your DBAs wont let your app create a database or modify db schema on their server.  In that case you can produce SQL DDE Scripts from the pub wiz, (if I recall correctly) or at that point it's prolly better to strictly use external datasource. 

    HTH,

    Josh


    • Edited by joshbooker Friday, October 9, 2015 6:33 PM
    • Proposed as answer by Angie Xu Wednesday, October 21, 2015 7:43 AM
    • Marked as answer by kencar Wednesday, October 21, 2015 11:51 AM
    Friday, October 9, 2015 6:30 PM

All replies

  • Hi Kencar,

    This forum is about Visual Studio Setup and Installation, as your issue would be related to LightSwitch, I help you move this case to Visual Studio LightSwitch - General Questions forum for dedicated support.

    Thank you for your understanding.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click HERE to participate the survey.

    Wednesday, October 7, 2015 2:07 AM
  • Hi,

    From your description above, I'm afraid that we can't change default configuration of intrinsic Database/Provide Regenerate option for Intrinsic DB. We received similar feedback before, see: https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2725136-change-default-configuration-of-intrinsic-database

    Generally you can add a database project to your LightSwitch solution, the contents of that project are incorporated into the intrinsic database that LightSwitch deploys when you build or deploy your application.

    More information: Managing Data in a  LightSwitch Application

    Please let me know if you need any help.

    With regards,

    Angie


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 9, 2015 7:20 AM
  • Angie,

    So am I to understand that this database structure is part of the web content?  If so I would need to know the specific limitations that follow it related to capacities because management is going to require that for planning and forecasting of solution lifecycle.

    It would/is a wonderful thing not to have to concern oneself with this issue, but the documentation issue doesn't go away.  I work for an organization that is meticulous about reporting and documentation, therefore as we deploy any new piece of code we have to provide parameters by which future growth will drive additional cost in further development and infrastructure enhancement to support the tools process.  Therefore, my understanding of the limits going in is critical to my usage.

    Regards,


    Ken Carter

    Friday, October 9, 2015 11:42 AM
  • Hi Ken,

    In LS we have the choice between internal and external SQL Server databases. 

    Internal or 'intrinsic' is a SQL Server database created and managed by LS tooling.  When you create\modify tables in the LS entity designer, you're affecting the intrinsic database called ApplicationData.  LS automatically handles applying schema changes to the intrinsic db at build/deploy time.  During debug, the Applicatoin Database is created in the localdb SQL Server instance.  For production, you specifiy the server/database in the LS publish wizard.  Therefore the limitations are related to those in the SQL Server instance to which you choose to publish.  If you publish to SQL Express on your local network, the limitations are those for Express.  If you publish to a scalable Azure SQL cluster, then those limitation apply. 

    Alternatively, external SQL Server databases are attached to your project and tables are not editable in the entity designer.  Changes are made to your database typically using T-SQL or SSMS and then schema changes are sync'd in your LS app using the 'update datasource' function in LS.  LS build\deploy does not make any changes to your external database and the same option for specifying production server connection is present in LS pub wiz.

    To summarize: in both scenarios, you choose the SQL Server instance where the production database will be, (for intrinsic, LS applies schema changes - for External LS assumes it's already there and schema matches) and the limitations & capacities are determined by those of the respective instance.

    Lastly, there is no officially supported way of 'converting' from intrinsic to external.  Dave at Xpert360 is the only one I know of that has successfully done so:

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/9ad542f8-7169-48b6-8c94-813a61b1e299/can-i-change-the-lightswitch-internal-database-to-an-external-copy?forum=lightswitch

    HTH,

    Josh


    • Edited by joshbooker Friday, October 9, 2015 1:51 PM sp
    • Proposed as answer by Angie Xu Wednesday, October 21, 2015 7:43 AM
    Friday, October 9, 2015 1:44 PM
  • I'm seeing that Josh. A lot of light is filtering in this morning. It's seems I've learned a lot for little good because I can't use it. I'm going to have to go back to standard web dev it looks to me. I can use this for personal and small corporate projects where we don't have business critical data that must meet specific handling (aka no cloud and restricted to corporate resource).

    Nothing is ever a complete loss.  Learning is a gain.

    Regards,


    Ken Carter

    Friday, October 9, 2015 3:20 PM
  • But Ken you can publish to an internal web server and internal SQL server.  I don't get why LS won't hit any corp policy)
    • Edited by joshbooker Friday, October 9, 2015 4:12 PM
    Friday, October 9, 2015 4:12 PM
  • Because of where it holds it's data is the problem.  It's perfectly fine if I would choose to use exclusively external data sourcing, but that somewhat defeats the purpose and eliminates some of the functionality.

    We have strict rules regarding the handling of information that we must adhere to.  It just wouldn't work in this data model.


    Ken Carter

    Friday, October 9, 2015 6:01 PM
  • It holds it's data on SQL Server, only data entered during debug is saved in the local ApplicationData.mdf. We typically don't enter sensitive data subject to strict handling rules during debug.
    Friday, October 9, 2015 6:09 PM
  • Are we talking about the same thing? I'm talking about where there is capture of data and there is usage of intrinsic database involved. That is where we'd have a problem with the rules. We'd be okay if we used external data sources with LS.

    The only time these rules would hamper the use of LS is when the specific data being managed by the application was not being stored on separate SQL server and the data was considered business critical data.


    Ken Carter

    Friday, October 9, 2015 6:17 PM
  • The only time these rules would hamper the use of LS is when the specific data being managed by the application was not being stored on separate SQL server and the data was considered business critical data.


    Then there is no problem. 

    We're talking about the same thing, but maybe you're missing the fact that the only the development db is local and it never contains production data.

    So, assuming you don't enter sensitive data during debug, such data will always and only exist on the server to which you publish the production application. 

    The internal\external discussion is only about development - if LS is responsible for schema changes then it's internal else schema changes happen externally. 

    In both cases the deployed app connects to any SQL Server you specify - in that way all prod apps use a SQL server that is 'external' to the application.

    Typically the most common type of IT policy that prevents folks from going intrinsic is when your DBAs wont let your app create a database or modify db schema on their server.  In that case you can produce SQL DDE Scripts from the pub wiz, (if I recall correctly) or at that point it's prolly better to strictly use external datasource. 

    HTH,

    Josh


    • Edited by joshbooker Friday, October 9, 2015 6:33 PM
    • Proposed as answer by Angie Xu Wednesday, October 21, 2015 7:43 AM
    • Marked as answer by kencar Wednesday, October 21, 2015 11:51 AM
    Friday, October 9, 2015 6:30 PM