Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Sitka
Aged Yak Warrior
571 Posts |
Posted - 2002-07-16 : 10:28:23
|
| Like the one herehttp://www.sqlteam.com/Forums/search.aspSearch by member...although I can not tell if it is cached, hardcodedwhatever. But the idea is I need a semi-dynamic one running on iis4/iis5. As in rebuild the html once a day.This is for a Purchase Order Queue so the list can get pretty long. The only validation is that the PO number has to have a certain format, not in the list etc. So the report won't fail if a certain PO number isn't avaialable in the list.I'm envisioning:If last accessed time > 5 hours ago thenrewrite an include file(via ScriptingObject)elseuse the existing include fileend ifThe include file would contain the html for the drop down. I'm away from my desk and have some surfing time and this was something I wanted to look at. Haven't found many good links to the technique which makes me think it is a lousy way to do it. Still would want to see. Or the best method to do the same thing. Whatever, it has been awhile since I looked at the stuff so just generally, thanks. |
|
|
Page47
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2002-07-16 : 10:39:07
|
I've used the Web Assistant Wizard for such things, with moderate success. In a production environment, I'd probably be tempted to write my own job that create the include file based on the result of a query, and then schedule the job once per day. Same functionality as the Wizard, except, I don't believe in magic when it comes to computers ....<O> |
 |
|
|
MichaelP
Jedi Yak
2489 Posts |
Posted - 2002-07-16 : 11:55:11
|
| Look on http://www.4guysfromrolla.com about storing information in Application variables. You should be able to "create" your HTML for your drop down one time, each time the application starts, using the Global.asa file.That way, the HTML is stored in local memory, and it's REALLY fast.Michael<Yoda>Use the Search page you must. Find the answer you will. |
 |
|
|
Sitka
Aged Yak Warrior
571 Posts |
Posted - 2002-07-16 : 12:02:14
|
| Web Assistant Wizard, didn't think of that one. I'll check it out.? As an aside where does one establish the division of labour in this case, and how to document the interaction.Micheal P...I read the forums post here but kind of dismissed it because the application starts only once. Or so I thought.Edited by - sitka on 07/16/2002 12:37:13 |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-07-16 : 12:56:41
|
quote: As an aside where does one establish the division of labour in this case, and how to document the interaction.
Usually you'd have to test your current solution(s) and see if it performs adequately. If not, then you test to see where the problems lie. Using a stress tool from MS on you web page can help. Michael's suggestion is the standardized way to do this kind of thing, since it's mostly done using ASP pages, and it's pretty easy to do. The only possible reason NOT to use it is if you can't use ASP. So if you need to keep the page as (relatively) static HTML, the Web Assistant and/or sp_makewebtask are a neat idea to try.BTW, you can write some simple code to schedule an update to the application variable that holds your menu items too. Or keep them in an XML or other file that gets updated automatically. There are probably 50 ways to do this kind of thing.As far as deciding whether to have the SQL Server or web server do the work, again you have to run tests to see how different approaches perform. In documenting the approach you use, the tests will give you a nice foundation for describing what you did and why you did it that way. |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2002-07-16 : 20:55:32
|
quote: I read the forums post here but kind of dismissed it because the application starts only once. Or so I thought.
Application_onStart only fires once but you can still use application values.Basically you store the HTML for the dropdown as well as a "last refreshed" time. When you call the function to make the dropdown it looks at the last refreshed time and decides whether the data is out of date (say, 20 minutes old, or a day, or whatever). If the cache is still good, use it. If it is out of date, re-generate it, use the new one, and refresh the cache and update the "last refreshed" time.What it means is, one user every hour (or however long your cache is) has to wait an extra few seconds but for every one else it will be lightning fast as it is coming straight out of memory.There is a whole section on caching at 4guysfromrolla, it's good stuff Damian |
 |
|
|
Sitka
Aged Yak Warrior
571 Posts |
Posted - 2002-07-17 : 10:30:43
|
| Thanks Merkin for explaining the mechanism. What you explained jives with the approach I would hunt down, you have confirmed that direction. Haven't done it yet, but I can see wanting to know the technique for a lot of cases. I started with the engineering groups' intranet where a lot of things need total concurency, but some aspects like user administration could take advantage of these caching techniques. I think the apps I've inherited and built have a legacy of small user base so perf. hasn't been an issue(misnomer). But the one machine serving an instance of the long PO dropdown definately complains that is why I'm looking for "the way". (Yeah late in the game I know, but there are always squeekier wheels). I'll get on it.The other approach...Spent 20 minutes with the Web Assistant last night, right on, got a result set like this<option>xxxx01</option><option>xxxx02</option><option>xxxx03</option>......runs every 5 hours drops it in a mapped drive locationBut need some trial and error time with sp_makewebtask to get the proper formatting in the output file and configure the template.file properly. This is one of those cases where BOL is directly telling me what to do but I'm not sure what I just read.(<%begin_detail%> can be used to granularly control <tr> tags how?maybe like this <!-- -->, to get rid of 'em) anyways I feel kind of bad about posting this because last three days I've been distracted as 'all get out' so victory posts may not be pending. To counteract the hurry up and wait role I have had to play. I just received two classic volumes by Ken Henderson, on the recommendation of many here. I clicked through SQLTeams site to Amazon. Hope you guys get a cut.Back to Unigraphics, you never forget your first love. |
 |
|
|
KHeon
Posting Yak Master
135 Posts |
Posted - 2002-07-18 : 09:21:02
|
| I agree, template creation is a bit wacked. It would be nice to be able to use ASP syntax and logic to build the output file, but it seems like the syntax is very similar to that of Index Server (which I know little about).QUESTION: My biggest gripe with Web Assistant is not knowing what "jobs" have been created and for what database. What would the SQL be to find a list of created web tasks?Thanks!Kyle HeonPixelMEDIA, Inc.Senior Application Programmer, MCPkheon@pixelmedia.com |
 |
|
|
|
|
|
|
|