Ash Sharma

Ash Sharma

  • NA
  • 11
  • 436

Source Control Data Inserts using SSDT

Feb 27 2018 5:30 PM
I have a website called "ReportDownloads" which shows a list of reports that Buisness can download for decision making.
 
As shown here, the table ReportDownloads look like this:
 
ReportName SQLQuery
DailyReport SELECT * FROM....
 
When the user click on any of the report, the report execute a SQL Query as written in SQLQuery column to build that report.
 
The requirement is if we want to edit that report, we need to change the SQLQuery, but lets say with multiple release of the same report, we don't want to insert multiple rows for same ReportName, we always want to have one row with most updated SQLQuery. But we do want to keep track of the changes made in each SQLQuery. This I believe can be done using Post Deployment Scripts with SSDT and we would be able to source control our all SQLScripts.
 
I am having hard time understanding PostDeployement Script.
 
Can someone please explain, how it can be achieved in Visual Studio 2015 with SQL Server Version 2008

Answers (5)