SAF(NET) = STEPHEN A. FUQUA operating on the Web since 1995

Stephen is a web developer, Bahá'í, and interfaith activist in St. Paul, Minnesota. He likes to write about religion, social justice, sustainability, science, programming, &c.

C#: The Dangers of Foreach July 8, 2008

Although very handy, C#'s foreach statement is actually quite dangerous. In fact, I may swear off its use entirely. Why? Two reasons: (1) performance, and (2) predictability.

Continue reading "C#: The Dangers of Foreach"

Posted by Stephen at 6:55 PM | Comments (0) | TrackBack (0)

MSSQL 2005: Indexed Views June 16, 2008

Good article on using indexed views: Indexed Views Basics in SQL Server. Similar good coverage in Ben-Gan's Inside Microsoft SQL Server 2005: T-SQL Programming. Problem: both specify that the hint WITH(NOEXPAND) needs to be used when executing a query against the index on anything other than Enterprise and Developer. However, I've found that it is also required for Enterprise.

Posted by Stephen at 2:39 PM | Comments (0)

Identifying Highly Fragmented (and important) Indexes May 23, 2008

Problem: SQL Server 2005 queries that used to be fast are now rather slow. You've already tuned the query with good indexes and optimized structures. You've checked the running jobs with Activity Monitor and don't see anything that should be slowing down the server. Likewise you've checked the memory and CPU utilization and they don't seem out of line. Did you check the indexes fragmentation? Ah, there's the problem – a highly fragmented index was slowing things down. Is there a way to pre-emptively find and fix these?

Continue reading "Identifying Highly Fragmented (and important) Indexes"

Posted by Stephen at 10:10 PM

SSIS: Access Is Denied from SQL Agent May 1, 2008

Problem: I have an SSIS package, MyPackage, stored on MyServer in the Package Store. I create an Agent to run the package, running under a SQL account hooked up to a proper proxy and credentials for Windows authentication. Works in development, doesn't work in production: the agent gets the error Connect to SSIS Service on machine "MyServer" failed: Access is denied.

Continue reading "SSIS: Access Is Denied from SQL Agent"

Posted by Stephen at 3:57 PM | Comments (0) | TrackBack (0)

Updating the GUI Before a Method Completes April 28, 2008

As a Web developer whose formal programming training focused only on console applications and simple GUI apps, it was not immediately obvious to me how to update a (Windows Forms) GUI while a method was still running. Once I decided it was worth the effort to learn how to do so, I was not surprised to find that it is rather easy, using BeginInvoke().

Continue reading "Updating the GUI Before a Method Completes"

Posted by Stephen at 9:50 AM | Comments (0) | TrackBack (0)

Sample Code for Using the XML Datatype in SQL Server 2005 March 24, 2008

I mentioned using the XML datatype for sparse column support in my recent post on some of the Useful Features in SQL Server 2008. Until today I had never had an opportunity to actually use this feature. I was pleasantly surprised at how easy it was to use, especially with some help from Itzik Ben-Gan's Inside SQL Server 2005: T-SQL Programming.

Problem: I've begun using data-driven subscriptions in SQL Server Reporting Services. I want to create one table to house subscription data. Various reports will have different parameters, both in number and kind. It is impractical to create one column for each possible parameter, and seems senseless to create a separate table for every report.

Continue reading "Sample Code for Using the XML Datatype in SQL Server 2005"

Posted by Stephen at 4:27 PM | Comments (0) | TrackBack (0)

Summary of Useful Features in SQL Server 2008 March 4, 2008

SQL Server 2008 will be coming out sometime this summer (in theory). At last week's TechFuse event in Minneapolis, and in blogs I sometimes read, I've started to pick up on a number of useful features and improvements that should make one strongly consider upgrading when the Release to Market (RTM) is ready (certainly this is not all-inclusive):

Continue reading "Summary of Useful Features in SQL Server 2008"

Posted by Stephen at 10:29 AM | Comments (1) | TrackBack (0)

RS and XSLT, pt3.1: Using XSLT for Custom Reporting Services Output February 28, 2008

The last two posts have touched on some issues related to Reporting Services and XML transforms. Now I'll go back and put the pieces together, flesh in some more detail, and try to give a coherent picture of what I was trying to accomplish and how it worked out. Doing so will require a sub-series of posts, call them parts 3.x to the "RS and XSLT" series.

Problem: A customer has asked for a report, in plain ASCII text, that will contain a header record, a bunch of pipe delimited detail records, and a trailer record. Reporting Services' subscription capabilities are ideal for the report delivery, but does not have any built-in way to support this kind of output. One can use CSV export, but:

Continue reading "RS and XSLT, pt3.1: Using XSLT for Custom Reporting Services Output"

Posted by Stephen at 2:54 PM | Comments (0) | TrackBack (0)

deprecated

On safnet.com

Other sites managed or developed by S.A.F.

S.A.F. elsewhere on the web

  • LinkedIn
    LinkedIn can actually be useful when looking for prospective hires and business or organizational partners
  • GoodReads
    A fun and relatively-unknown social networking site geared towards one's book list
  • Live Journal
    Mirror of the blog at safnet.com, so that a few LJ friends can more easily read and comment there