SQL Server: Loading all the values from a table into a single line (via Tone’s Enterprise Dot Net Blog)

It's a common requirement to load all the values from a table into a single line for consumption. For example, you might retrieve a User record, but you want the list of roles that the user belongs to in a single comma separated line. The usual way of performing this was to create an inline function, pass it the UserId of the record and have it build the list. The problem with that is the inline function – it causes a table scan, which is highly … Read More

via Tone's Enterprise Dot Net Blog

Advertisements

About Brian McKay
Software Architect

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: