Have following statement that comes from a view on corporate database through linked server on local database.SELECT eveID, sitID, EventDate, inrCode FROM OPENQUERY(corporateServer, 'select * from corpServer.corpDB.dbo.vw_HealthAndSafetyEventList') AS HSEL WHERE (siteID = 11) ORDER BY EventDate DESC, safetyCode
Need to pull certain safetyCodes, subtract EventDate from todaysDate, count certain records, etc.Should I throw this into a table or view on the local database? Should I run it as a stored procedure on a daily schedule?The data will be used on an intranet site ASP page and I think I want to do most of the calculations on the sql side and not directly on the ASP page.Problem is I am a newbie and need direction. Thanks for the help.