LessThanDot Site Logo

LessThanDot

A decade of helpful technical content

This is an archive of the posts published to LessThanDot from 2008 to 2018, over a decade of useful content. While we're no longer adding new content, we still receive a lot of visitors and wanted to make sure the content didn't disappear forever.

What exactly is Fragment_count?

I started to think about this problem, when I saw this question asked by Sankar Reddy in SQL Server Quiz 2010. I have a fair bit of idea about Index fragmentation and defragmentation. I checked fragmentation of some of my table indexes previously and rebuilt the indexes when fragmentation percentage is too high. But I never thought about how exactly these will be calculated. But after looking at this question, I thought of finding how SQL server will calculate this.

Read More...

Why (and How) I Model

Over my years in (and before) IT, I’ve seen long projects, failed projects, confused projects, wildly successful projects, and even fun projects that ended far differently than we expected. The consistent take-away for me is that I am a big picture type of person, and that understanding that big, abstract picture cuts out a lot of wasted time sprinting down the wrong paths. Don't Sprint Blindly... (care of dmitriev.com) Creating a model forces me to refine a concept down to it’s simplest elements, forces me to face the unknowns that my mind has so casually been skipping over.

Read More...

Wisconsin SQL Server User Group

Tomorrow night I will be talking about Execution Plans for the Wisconsin SQL Server User Group. This is a new session for me and I think the group and I will have a great time discussing how important it is to dig deep into plans. Execution plans are without a doubt a point in the tuning process in which we can either make a database server live or land face first on the floor.

Read More...

The History of SQL Server Integration Services

The history of any product is important to fully understanding the product itself. With the knowledge of the foundation of a products birth, we can start to learn the depth of where it has come as it has aged over the years. SQL Server and all its features are no different. We may find ourselves disliking a product before taking full advantage of the abilities offered. SQL Server has had many levels of growth over the years as a relational database management system.

Read More...

Security Auditing a Database

Earlier this week I decided that I wanted to generate a report that shows me how the security is set up on my databases. I’m mainly intersted in my database roles and how they’re set up, and logins assigned to the database. So I did some snooping around and generated 3 queries for myself. select dpr.name, dpr.principal_id, dpr.type, dpr.type_desc, dp.class, dp.class_desc, dp.major_id, dp.minor_id, dp.grantee_principal_id, dp.permission_name, case dp.state when 'g' then 'granted' when 'd' then 'denied' else 'n/a' end AS [state], ao.

Read More...

Parsing the Address field to its individual components

This blog post is a result of the currently active thread at MSDN T-SQL forum Parsing Address field to its components The question of parsing a row data with bad formatted addresses often comes in the SQL newsgroups. Unfortunately, there is no universal 100% bullet-proof solution that covers all possible scenarios. However, for a common scenario of City, State Zip the parsing can be done using the following technique: declare @t table (Address varchar(max)) insert into @t select 'ROSSIVILLE, GA' union all select 'LEESBURG, FL 34788' union all select 'COLUMBUS, OH 43221' union all select 'FORT BELVOIR, VA 22060' union all select 'MADISON HGTS, MI' union all select 'PALM BEACH, FL' union all select 'MCDONOUGH .

Read More...

Passing multiple ranges to stored procedure

This blog was inspired by the following thread at MSDN Transact-SQL forum: Multiple values in field as parameter Given a string with values such as ‘201|203|301|400..600|725|800..900’ return records from the table where Code field will be any of the values passed with | as a delimiter and also within the passed ranges where range indication will be .. The first idea that comes to mind is to use various splitting techniques available (see, for example, this excellent blog by Aaron Bertrand Splitting List of Integers or follow up by Brad Schulz Integer List Split – a SQL fable or the old times classic by Erland Sommarskog Arrays and Lists in SQL Server) split the list first by | and then, if needed by .

Read More...

SSIS runs in BIDS but not with SQL Agent

The title of this article is one that is asked on many occasions around the forums and SQL Server community. SQL Server Integration Services (SSIS) is the Extract, Transform and Load (ETL) platform behind SQL Server. There aren’t many arguments against SSIS as a great tool, and it has the ability to get the job done as an ETL platform. With the added complexity of any product, pain is involved while becoming familiar with the intricacies of it.

Read More...

The last one

Introduction Well this is to be post number 250 and the final one from me on this site. Perhaps you like to know why I started blogging in the first place? More then 2 years ago this site started and the best way to get views is to add content and so I did that. I started blogging just to give us content. That’s how simple it is. The past It is kinda time for a “best of” I guess.

Read More...

Writersblock

I have been wanting to write my last real blogpost on this site for a few days now and I have nothing to write about. I have thought of plenty of things to write about but they all seemed so trivial. I was gonna write about interview questions but it has been a while since I done any real interview myself and I never ever had to interview someone else. So the whole exercise would be pointless because it would just be theoretical.

Read More...