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.
Your profile
Tag cloud
book bug business intelligence database dates dmv functions gemini gotcha how to howto indexing interview madison performance performance tuning postgresql programming sql sql friday sql server sql server 2000 sql server 2005 sql server 2008 sql server 2008 r2 sqlserver t-sql tip trick xml
Authors
- SQLDenis (166)

- onpnt (86)

- George Mastros (32)

- chrissie1 (8)

- naomi (7)

- emtucifor (6)

- Alex Ullrich (6)

- thirster42 (4)

- ramireddyindia (2)

- riverguy (1)

- tarwn (1)

- pmch22 (1)

- More...
Main Categories
Search
Google Ads
Tags: t-sql
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...
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
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...
So I posted a teaser in the puzzles forum. Without running this, try to guess what will happen?
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 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 ...
:: Next >>


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