Question

I have a vendor SQL Server 2008 db which I am trying to add-on to with additional tables etc. to customize for my order processing .Net 3.5 site. The vendor db should not be altered. However I need to record the current Order Status which is not included in the vendor's db.

Currently I'm using a VIEW with a CASE to get the Status based on data in the Orders table. To improve performance I'd like to create a new Status table with OrderID & Current_Status.

To keep the Status table up-to-date is there an alternative to frequently running a script which will look at all Orders and update the Status table accordingly?

Was it helpful?

Solution

Creating a job or other polling-type solution is probably fine if the load imposed by the query is not high and if you can tolerate some delay before the data is synched.

If you can tolerate at least some delay, but the query to check the table is extensive, or if you have several tables you want to perform this operation on, you could also use Change Tracking, since you have SQL Server 2008.

Here's a link on how to use it.

OTHER TIPS

Create a SSIS job to check orders and update the status table. And schedule it to run hourly/daily(as per your requirement). Creating SSIS jobs will not affect any of your vender process or objects.

If performance is your worry, how about an indexed view?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top