Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Data Management

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

Search

XML Feeds

Google Ads

Tags: t-sql

comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

The differences between LEN and DATALENGTH in SQL Server!

I have seen a bunch of questions about this recently and decided to do a little post to clear up the confusion.

First let's take a look what Books On Line has to say about these two functions

LEN

Returns the number of characters, rather than the number of bytes, of the given string expression, excluding trailing blanks.

DATALENGTH

Returns the number of bytes used to represent any expression.

So what does that mean? It means that the LEN function will f...

Read More...
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

You have a table with integer values and you are required to always show 8 numbers, if the length of the number is less than 8 characters then you need to pad it. Of course stuff like this should be done at the presentation layer but we all know that sometimes that means reinstalling apps so SQL is the easiest way. Numbers like these are usually order or customer numbers.

The easiest way to pad a number in SQL is by using the following syntax

tsql Sample Code (See Article for Rest)
Read More...
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

FIX: A MERGE statement may not enforce a foreign key constraint when the statement updates a unique key column that is not part of a clustering key and there is a single row as the update source in SQL Server 2008

In Microsoft SQL Server 2008, a foreign key constraint may not be enforced when the following conditions are true:

• A MERGE statement is issued.

• The target column of the update has a nonclustered unique index.

Microsoft has created the first Hotfix for SQL Server 2008 which will fix this issue.

You can read more a...

Read More...
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

So I posted a teaser in the puzzles forum. Without running this, try to guess what will happen?

tsql Sample Code (See Article for Rest)
Read More...
comments
Rate Post:
submit to reddit Digg!FacebookDotnetkicks

There are 3 versions of SQL Server 2008 Express now available for download from the SQL Server 2008 Express site. Below are the 3 different versions

SQL Server 2008 Express

  • SQL Server database engine - create, store, update and retrieve your data

SQL Server 2008 Express with Tools

  • SQL Server database engine - create, store, update and retrieve your data
  • SQL Server Management Studio Basic - visual database management tool for ...
Read More...

:: Next >>