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…
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.
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…
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
Return data type
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()…
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,…
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…
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 […]
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 […]
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 […]