I know this is a little strange, but if someone helped, it would be very helpful.
The scenario is that we have a production database on a remote site and a developer database in our local office. Developers make changes directly to the developer db, and as part of the deployment process, they launch the C # application and create a series of .sql scripts that we can execute on the remote side (essentially delete *, insert), but we are looking for something a little more complex. since downtime from removal * is unacceptable. This is all reference data that controls menu items, functionality, etc. The main website.
I have a sproc that essentially returns the diff of two tables. My thinking is that I can insert all the expected data into the tmp table, run diff and delete something from the destination table that is not in the source code, and then do the rest.
The question is, is there an easy way to do this without using a cursor? To illustrate, sproc returns a recordset, structured as follows:
TableName Col1 Col2 Col3 Dest Src
Everything that is contained in the recordset with TableName = Dest must be deleted (since it does not exist in src), and anything in Src must be added to dest. I can't figure out how to do this purely on a set basis, but my DB-fu is weak.
Any help would be greatly appreciated. Sorry if the explanation is sketchy; let me know if you need more details.