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
.net asp.net asp.net mvc azure book bug business intelligence c# cloud computing database dates excel functions gemini google gotcha how to howto iis interview kanban linq madison measurement mvc nhibernate nunit performance process improvement programming rhino mocks security silverlight sql sql friday sql server sql server 2000 sql server 2005 sql server 2008 sql server 2008 r2 sqlserver structuremap t-sql tip trick unit testing vb.net vista visual studio 2010 windows 7
Authors
- SQLDenis (269)

- chrissie1 (200)

- onpnt (96)

- George Mastros (35)

- Alex Ullrich (24)

- tarwn (17)

- naomi (9)

- ca8msm (7)

- damber (7)

- thatrickguy (7)

- emtucifor (7)

- chopstik (6)

- More...
Main Categories
Search
Google Ads
Tags: functions
T-SQL To find Out If An Index Is Clustered Or Non Clustered
I saw this question in in Google Analytics from a Google search that hit our site.
So, how can you determice if an index is clustered or not? There are two ways, you can use either the INDEXPROPERTY function or the sysindexes/sys.sysindexes system table/view
To see how it works we will create a table with one clustered and one non clustered index on it
Here is the code for that
Use INDEXKEY_PROPERTY in SQL Server to determine if columns in indexes are sorted ascending or descending
How can you find out if the columns that are part of the index are sorted descending or ascending in that index? For example when you create the following index
Replace Your Case When Then Else Syntax With the Sign Function In SQL Server
If you want to show a 1 when there is a value for something in the column and 0 if none of the rows have that values you typically do something like this
ISO Week in SQL Server
First let's take a look at what ISO week is, from WikiPedia:
Week date representations are in the format as shown below.
YYYY-Www or YYYYWww
YYYY-Www-D or YYYYWwwD
[YYYY] indicates the so-called ISO year which is slightly different than the calendar year (see below). [Www] is the week number prefixed by the letter 'W', from W01 through W53. [D] is the weekday number, from 1 through 7, beginning with Monday and ending with Sunday. This form is popular in the manufacturing industries.
There are mutually equivalent definitions fo...
Good SQL Articles To Read If You Can't Afford Books
You have only $50 left and you can buy two DVDs or one SQL book, what do you do? I would buy the book but not every person has the same idea of a fun time. This is the reason why I present you with a bunch of links to articles which will give you very good info. Some of this you won’t be able to find in a book anyway.
The curse and blessings of dynamic SQL. How you use dynamic SQL, when you should - and when you should not.


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