SQL tasks automation: apply scripts from folder

You will be amazed how common this question is: I have a folder with arbitrary set of SQL scripts and want to apply them all automatically. How do I do that? In other words: Having a folder – ex: C:\AutoSQLScripts – with some unknown set of SQL scripts And a SQL Instance where scripts need to be applied Run a scheduled task to perform the operation automatically. Solution: First, lets figure out single operation – run SQL Script from command line in unattended mode using osql utility: :: osql -S MYSERVER -d MYDATABASE -E -i MySqlScript.sql  -o report.txt :: Where: -S indicates server name -d is an alternative to USE db_name inside the script -E indicates that trusted connection would be used -i identifies the file that Read more

Crystal Reports 2008 and ASP.Net : speed up the first session

Did you ever noticed that after restart of the IIS ASP.Net page which has Crystal Reports Viewer would take much longer to come up? Some of it is expected since on initial start up, a number of Crystal assemblies and objects need to be created and this does take time. I want to emphasize that discussion below is related to the first run of any reports. We have to actually restart/reset IIS to see problem again. Note: There was a question about IIS’ Application Pools recycling which could cause similar effect. Make sure your application pool is set properly. Setting up a playground Let’s assume ASP.Net pages were already migrated to use .Net 3.x and look at what happen behind the scene. Remember that after Read more

How to embed Google Docs document into your page

Google has changed how Google Docs are exposed. As result method discussed in this article is no longer applicable. Please explore other options (ex: Google Sites). Thank you. There are plenty of presentations, documents, and spreadsheets we may want to share with the world. We can use homegrown document handling solutions, use commercial 3rd party solutions or… utilize power provided by Google Docs. When storing articles on Google Docs you are provided with the option to share them with some people only or with everyone. I like to have option to link my articles from anywhere but I also like to have not just plain page, but a page embedded into my web-site pages. What it means is that instead of external Read more

Expiration of CrystalReport Viewer pages with long running queries

Wow! It worked… I continue my journey with Crystal Reports Viewer (CRV) inside ASP.Net pages. Topic of this post is to discuss problems and solutions related to long running queries in CRV. I would like to thank Daniel Paulsen from SAP team for his help resolving the issue discussed below. What are we talking about here? As it usually happens at some point there is to much data/not optimal query/broken indexes/etc and it is takes significant time to return a result for CR report. As a result ASP.Net page with CRV start to throw errors, acts erratically, and overall strange. Since we know that it is ASP.net and CRV uses page state and session information then we have usual suspects – session Read more

Is going Linux means replacing I with We?

There we go again… Marketing wars… Is being Linux means replacing I with We? Accordingly to a new addition to the Mac-v-PC adv. war – Linux – “WE are Linux” – yes. Personalization in the look at the computers promoted for last few years by Apple, Microsoft, and then followed by Dell and others with “personalize your computer” campaigns now suggested to be replaced with big “communitification”  a-la Linux. What is a freedom? Ability to be you through the lens of the Big Brothers or ability to be you as part of the Open (Source) World of WE? Is it a freedom when someone tells you that “you are free to be me”? Does Linux community need to go into war Read more

How to set default file name for export from CrystalReportViewer in ASP.Net

I have had nice discussion about a new Crystal Reports based web-site today. And everything seems to be fine… Except users want to see a proper default name for the exported files… Environment: Crystal Reports 2008 engine IIS 7 ASP.Net 3.0 page with CrystalReportViewer (CRV) being used to show report passed by parameter When trying export as PDF (just an example), CRV defaults the name of the file to CrystalReportViewer1.pdf. Not very nice since associated RPT name is MyVeryOwnReport.rpt and I have many other which I would expect export file at least inherit. One would expect that Viewer would have a property allowing specify default export name. Not so fast… there is no such thing today exists. After some head scratching Read more