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.

Always include size when using varchar, nvarchar, char and nchar

There are several string data types in SQL Server. There are varchar, nvarchar, char, and nchar. Most front end languages do not require you to identify the length of string variables, and SQL Server is no exception. When you do not specify the length of your string objects in SQL Server, it applies its own defaults. For most things, the default length is one character. This applies to columns, parameters, and locally declared variables. The notable exception is with the cast and convert functions which default to 30 characters.

Read More...

SQL Server 2008 R2 Editions Pricing Announced

Microsoft has announced pricing and also what is new in the SQL Server 2008 R2 editions. First here is the pricing Editions <td> <strong>Per Processor PricingRetail **</strong> </td> <td> <strong>Per Server Plus CAL PricingRetail **</strong> </td> Parallel Data Warehouse <td> $57,498 </td> <td> Not offered via Server CAL </td> Datacenter <td> $57,498 </td> <td> Not offered via Server CAL </td> Enterprise <td> $28,749 </td> <td> $13,969 with 25 CALs </td> Standard <td> $7,499 </td> <td> $1,849 with 5 CALs </td> I wonder how many people will go to Datacenter or Parallel Data Warehouse editions? To be fair Sybase IQ charges I believe $40K per core, SQL Server 2008 R2 is priced per socket and would still be a lot cheaper than Sybase IQ

Read More...

Balsamiq Mockups – Turn Any Computer Into a Napkin

I’ve been working on a new web site for a while now, and finally got to the point where I need to make it look a little better. Figuring out page layouts is far from my strong suit, so I was looking for something to help make it easier. I’d tried a couple of free applications, and either found them too limited or too complex for my needs. I think that Mockingbird probably came the closest to what I was looking for, but the interface was just a bit clunky. Most of the commercial applications I’d come across were quite pricey, at least for what I was willing to sink into tools for a hobby project. Some chatter about Balsamiq came across on the twitters so I figured I would check it out.

Read More...

Test your Full Recovery model by restoring backups

A major point of failure in a full recovery model is not testing your backups. You should not limit this to your FULL backups either. If you have full recovery model on any of your databases there is more than likely (or should be) log backups being run based on either DR strategies or transaction log management. If you also have differential backups to take full advantage of the quickest path to restore, then all of these stages must be tested out.

Read More...

Don't prefix your table names with tbl

This is a naming convention issue. Tables should not be prefaced with tbl because it does nothing to add to the clarity of the code (self-documenting). It actually has the opposite effect because it takes longer to read it and causes you to perform an interpretation of the three letter abbreviation. How to detect this problem: Select * From Information_Schema.tables Where Table_Type = 'Base Table' And Table_Name Like 'tbl%' How to correct it: Rename the table to remove the prefix. This is not as simple as it seems because this table could be referenced from a number of places, including views, stored procedures, user defined functions, index creation scripts, in-line SQL (embedded within front end applications), etc…

Read More...

Microsoft Access Wikis on LessThanDot

Here is a list of the wikis that refer specifically to Microsoft Access, however, a great many ideas from other areas, such as SQL Server, can be transferred to Access, so don’t stop here! You can also post in our forums (Access VBA & Jet SQL, Access Forms & Reports), if you need any help, or would like to help others. It is important to remember that Access uses the Jet database, for the most part, but both halves of this union, Jet and Access, can be used separately. It is something I often forget 🙂

Read More...

Validating a domain model/objects

One of the biggest problems you will encounter in your career as a developer is pesky users. They always seem to enter the wrong data. So we need to validate their input into your brilliant system. There are several ways of doing this when using a domain model. First, you could make sure that all your properties and constructors are designed in such a way that your object can never be in an invalid state. [I wrote about this before][1]. The biggest problem with this, is that it can get problematic really fast. I would therefore only advise such an approach for simple objects. Really simple objects.

Read More...

Don't start your procedures with SP_

When SQL Server executes a stored procedure, it first checks to see if it is a built-in stored procedure (system supplied). It checks the master database for the existence of this procedure. If the procedure is not found, it will search the user database. It doesn’t sound like much, but in a high transaction environment, the slight performance hit will add up. Also, consider what would happen if Microsoft decides to ship a system stored procedure with the same name as the procedure you wrote. Suddenly, your procedure will stop working and the one supplied by Microsoft will be executed instead. To see what I mean, try creating a stored procedure in your database named sp_help. When you execute this stored procedure, SQL will actually execute the one in the master database instead.

Read More...

LessThanDot Redesign – Here We Go

Done, Skip to the bottom! Over the course of the next hour the LTD website will be undergoing conversion to the new format. What this means is that we will spend about the next 15 minutes or so without any visible changes. Then everything will break horribly. Then (hopefully) everything will look right again and we will be on the new layout. Done! – Basic Backups as precaution Done! – Copying new files and breaking site Done! – Configuring Forum Done! – Configuring Wiki Done! – Configuring Blogs Done? – Final Tests I will continue to post updates as we go.

Read More...

SQL Server 2008 R2 Datacenter and SQL Server 2008 R2 Parallel Data Warehouse Editions Announced

Microsoft announced SQL Server 2008 R2 Datacenter and SQL Server 2008 R2 Parallel Data Warehouse Editions today at Pass. Also announced was a new world-record TPC-E benchmark result and the SQL Server 2008 R2 November CTP Microsoft is introducing two new offerings for high-scale, mission-critical applications. SQL Server R2 Datacenter delivers a high-performing information platform that provides high levels of scalability for large application workloads and managing an organization’s database infrastructure. With support for up to 256 logical processors and unlimited virtualization, SQL Server Datacenter and Windows Server 2008 R2 Datacenter provide a foundation on which to build enterprise-class solutions.

Read More...