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

LessThanDot

A Technical Community for IT Professionals

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.

Browsing "functions"

0

TRY_CONVERT in SQL Server Denali CTP3

TRY_CONVERT is a new function in SQL Server Denali CTP3, TRY_CONVERT enables you to test if a value can be converted to a specific data type, TRY_CONVERT returns a value cast to the specified data type if the cast succeeds; otherwise, TRY_CONVERT…

Read More...
0

Format function in SQL Server Denali CTP3

SQL Server Denali CTP3 brings a couple of new functions, one of these is the FORMAT function

The syntax of the format function looks like this

FORMAT ( value, format [, culture ] )

Here is what Books On Line has to say about the arguments that…

Read More...
8

Concat function in SQL Server Denali CTP3

SQL Server Denali CTP3 brings a couple of new functions, one of these is the CONCAT function. The CONCAT function returns a string that is the result of concatenating two or more string values.

The syntax of the CONCAT function looks like this

CO…

Read More...
5

DATEFROMPARTS and DATETIMEFROMPARTS functions in SQL Server Denali CTP3

Function

Syntax

Return value

Return data type

DATEFROMPARTS…

Read More...
5

A Quick look at the new EOMONTH function in SQL Server Denali CTP3

SQL Server Denali CTP3 has a bunch of new date/time functions like DATEFROMPARTS, DATETIMEFROMPARTS and EOMONTH

First let’s take a look at EOMONTH.

The syntax for EOMONTH is

EOMONTH ( start_date [, month_to_add ] )

If you pass in getdate()…

Read More...
7

A Quick look at the new IIF function in Denali CTP3

Denali CTP3 comes with the IIF function, if you have used VB or Excel then you already know how this function works. In essence this function is a shorter version of a CASE statement.

The syntax is as follows

IIF ( boolean_expression, true_value,…

Read More...
1

Use the GROUPING function to determine whether a value is NULL because of ROLLUP

If you have been writing queries that use ROLLUP, you are probably aware that the aggregated rows return NULL for the column that you are grouping by. What if you already have a NULL value in that column, how can you know which row is the aggregated row…

Read More...
3

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 […]

Read More...
2

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 CREATE CLUSTERED INDEX ix_test_clust ON test (id ASC, col1 DESC) How would you find out without scripting the index if the columns are in descending […]

Read More...
1

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 CASE WHEN SUM(CONVERT(INT,SomeValue)) > 0 THEN 1 ELSE 0 END Basically you sum it up and if the sum is greater than […]

Read More...
Next Page »