Compare And Update SQL Server Database Project With ...

文章推薦指數: 80 %
投票人數:10人

In this article, you will learn how to create a SQL Server Database project using Visual Studio 2019 and how to compare and update the SQL ... CompareAndUpdateSQLServerDatabaseProjectWithVisualStudio HabibUlRehman UpdateddateAug26,2020 65.9k 0 9 Inthisarticle,youwilllearnhowtocreateaSQLServerDatabaseprojectusingVisualStudio2019andhowtocompareandupdatetheSQLServerDatabaseProjectfromtheremoteSQLServerDatabaseandviceversa. facebook twitter linkedIn Reddit WhatsApp Email Bookmark Print OtherArtcile Expand Introduction   Whenweareworkingonanyproject,adatabaseplaysanimportantrole,andaftersometimewhenthenumberoftables,views,andstoreproceduresincreases,itbecomestoodifficulttomanagethedatabasechanges.It'sverydifficulttoupdateproductiondatabaseprojects.   Andevenafterthatwhenwemanagethedatabase,thenwestillneedtocomparewhichscriptwehaveworkedonandwhichareremainingonanyparticulardatabase.Therearemanygoodtoolsavailableinthemarketforcomparingdatabasesbutmostofthemarepaid.   So,inthisarticle,we’regoingtolearnabouthowtowecanmanageourdatabasescriptsusingVisualStudio’sSQLServerDatabaseProject.   Wecancreateanewdatabaseprojectandcomparefromanexistingdatabase,a.sqlscriptfileoraData-tierapplication(.dacpac).Wecantheninvokethesamevisualdesignertools(Transact-SQLEditor,TableDesigner)availableforconnecteddatabasedevelopmenttomakechangestotheofflinedatabaseproject,andpublishthechangesbacktotheproductiondatabase.Thechangescanalsobesavedasascripttobepublishedlater.UsingtheProjectPropertiespanel,wecanchangethetargetplatformtodifferentversionsofSQLServer(includingSQLAzure).   Prerequisite   VS2015orVS2017orVS2019shouldbeinstalledinyourmachine.   GettingStarted OpenVisualStudioandcreateanewprojectfromtheMenu,SelectFile>New>Project. SelecttheSQLServerDatabaseProjectfromthelist. EntertheProjectnameandclickoncreatebutton. Aftertheprojectiscreated,wecanseethedatabaseprojectintheSolutionExplorer. Right-clickonSchemaCompareDemoprojectandthenclickonSchemaCompareoptionfromthecontextmenu.  ThenclickonSelectTargettoselectthedatabase.  Thenclickontheselectconnection. Selectyourdatabaseorenternewdatabasecredentials.Selectdatabasenamefromthedrop-downandclickonconnect.   AfterthedatabaseselectionclickontheswitchbuttontoswitchsourcewithtargetbecausewewanttoupdateourlocalDBprojectfromaremotedatabase.  StartschemacomparisonbyclickingontheComparebutton.  Thecomparisonviewwillbeshownaftersometime.YoucanselectthechangewhichyouwanttomakeintoyourlocalSQLServerDatabaseProject.AfterselectionclickontheUpdatebutton. Aftertheschemaupdateiscompleted,openyourSolutionExplorer.AsyoucanseethatyourSQLServerDatabaseProjecthasbeenupdatedfromtheremotedatabase.    Allthetables,storedprocedures,viewsandetc.havebeenupdatedfromtheremotedatabase.   Wedon'tneedtowriteanymigrationscriptlikeweusedtodoforDBmigration.   Andafterthis,whenevertherearechangesinthetablesortheproceduresjustmakethechangestotheSQLServerProjectDatabaseinthesolution,compareandupdateyourchangestothetargetdatabase.VisualStudiowillupdatethetargetdatabaseaccordingly.   So,managingourdatabasenowbecomeseasierusingSQLServerDatabaseProjectandnowthereisnoneedtoworryaboutproductiondbupdates. SQLServerSQLServerDatabaseProjectVisualStudio NextRecommendedReading SmartMinds WeProvideWeb,DesktopandMobileAppsSolution FEATUREDARTICLES ViewAll TRENDINGUP 01ConsumingRESTAPIsInGolang02CreateRESTAPIWithGinFrameworkAndGolang03VisualStudioForGitHubRepository04TypeCheckinginC#05CI/CDPipelineUsingJenkinsAndGitHubFor.NETCoreWebApplication06AngularCRUDUsing.NetCoreWebAPI07PythonVariables08PropsInReactJS😝097MinutestoBetterSellingPodcastEp.29-Part210IntroductiontotheBlazorFramework-BlazorFrameworkLearningSeries-Ep.1 ViewAll LearnSSRSIn11Hours Challengeyourself ReactSkillChallenge GetCertified JavaDeveloper



請為這篇文章評分?