Jeff's SQL Server Blog

Random Thoughts & Cartesian Products with Microsoft SQL Server
posts - 149, comments - 1983, trackbacks - 64

My Links

SQLTeam.com Links

News

Welcome to my weblog. My name is Jeff Smith, and I am a software developer in Boston, MA. Check in frequently for tips, tricks, commentary and ideas on SQL Server and .NET programming.


Subscribe

Archives

Post Categories

Programming

Sports

SQL

.NET (C# / VB)

.NET is great, and I cover it a lot in my blog posts. SQL Server and .NET make such a great team that it can be tough to discuss one without the other.
Convert input explicitly at your client; don't rely on the database to "figure it out"

A common mistake beginners make when working with SQL is trying to format things at the database layer. I've covered that quite a bit in various blog posts, but I've only touched upon another similar issue which I feel is equally as important and also very often mishandled. read more...

posted @ Thursday, July 24, 2008 9:12 AM | Feedback (10)

Minimize a DropDownList's ViewState

posted @ Thursday, April 17, 2008 12:21 PM | Feedback (6)

DataTable, DataView and CreateDataReader

posted @ Friday, February 22, 2008 12:30 PM | Feedback (0)

Splitting a single DataTable into Parent/Child DataTables for Hierarchical Processing (e.g., nested ASP.NET Repeater controls)

posted @ Friday, November 02, 2007 12:16 PM | Feedback (0)

Creating CSV strings in SQL: Should Concatenation and Formatting Be Done at the Database Layer?

A question I see very often in the SQLTeam forums is how to return data in a summarized form by concatenating a list of values into a single CSV column. This can be done fairly easily in T-SQL, but as the formatting and concatenation requirements becomes more elaborate, be sure to ask yourself: Am I forcing presentation code into the database layer? read more...

posted @ Tuesday, October 09, 2007 3:02 PM | Feedback (18)

Using SQLBulkCopy to copy any .NET Object to a SQL Server Table

In my SQLBulkCopy article, I mentioned that you can quickly copy data from anything that implements IDataReader to a SQL Server table using SQLBulkCopy (new in .NET 2.0). In this SQLTeam forum post, Jesse Hersch (jezemine) tells us that SQLBulkCopy only actually uses 3 methods of the interface. This means that it is very easy to quickly create your own custom class which implements this interface to bulk copy pretty much any type of object collection or array to a SQL Server table.

posted @ Tuesday, May 22, 2007 2:40 PM | Feedback (3)

Using SQLBulkCopy to quickly transfer data from .NET to SQL Server

posted @ Monday, May 07, 2007 9:29 AM | Feedback (1)

Regular Expression Replace in SQL 2005 (via the CLR)

I had to do some data clean up the other day, and really needed some regular expression replacements to do the job. Since .NET has a great RegularExpressions namespace, and since SQL 2005 allows you to integrate .NET CLR functions in your T-SQL code, I thought I'd go ahead and experiment with creating a RegExReplace() function.

read more...

posted @ Friday, April 27, 2007 4:20 PM | Feedback (5)

Sorting Columns with the C# Pivot Function

Time for another exciting edition of the mailbag! This time: making an improvement to the C# Pivot function.

posted @ Friday, April 20, 2007 12:05 PM | Feedback (3)

ASP.NET 1.1 -- Appsettings in Web.config

It's great to be able to put settings in the Web.Config file for my ASP.NET projects. The problem for me, though, is that when I use System.Configuration.ConfigurationSettings.AppSettings(name) to return a setting that doesn't exist in the file ...

read more

posted @ Wednesday, March 28, 2007 12:09 PM | Feedback (4)

Always Use Parameters. Even if you don't use Stored Procedures.

Let's assume that for some reason you are not using Stored Procedures. While I can respect your choice in that regard, that doesn't mean that you cannot still use parameters when constructing your SQL statements at the client.

read more...

posted @ Friday, July 21, 2006 10:43 AM | Feedback (22)

Rendering Excel and Word files with SQL Server

I've been playing around with a handy tool for creating Word and Excel files called OfficeWriter that's pretty impressive.

read more...

posted @ Tuesday, July 18, 2006 3:05 PM | Feedback (2)

Minimizing the ViewState for an ASP.NET 1.1 DataGrid

By default, the ViewState for ASP.NET DataGrids can be quite large, as it normally stores enough information to recreate the grid completely after a postback. Often, I have found that I need the grid to display a list of items with only paging, sorting, and some buttons that let you delete or edit (via another page) individual items.

read more...

posted @ Tuesday, July 11, 2006 10:22 PM | Feedback (4)

.NET CrossTabs versus SQL Server CrossTabs

As promised in my last post, here is some performance testing to help you determine the performance benefits (if any) of performing your crosstabs at the presentation or code layer, as opposed to forcing SQL Server to do this.

read more...

posted @ Thursday, May 12, 2005 10:01 AM | Feedback (5)

.NET CrossTabs: Transforming a Normalized DataReader into a Pivoted DataTable

posted @ Wednesday, May 11, 2005 3:49 PM | Feedback (21)

Powered by:
[image] [image]


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser