|
|
-
|
|
Simple parameterization is SQL Server feature which allow the optimizer to parameterize submitted queries. If submitted query has no parameters and has constant values plugged in, the optimizer can choose to treat constant values as parameters and automatically create parameterized query and executi......
|
|
-
|
|
Recently I worked on a performance tuning of a database and noticed a lot of user created statistics. I checked few of them and saw that lots of user created statistics are multi-column statistics and some of them have a filter defined. There was no documentation of created statistics and I wanted t......
|
|
-
|
|
Did you ever need to see what execution plan will optimizer choose for your query on large set of data but you have a really small test database? Or you are testing your notification system for sort warning, for example, and you need to force query optimizer to think that tables used in a query are ......
|
|
-
|
|
Yesterday I saw a question about required permission for changing SQL Server login password and I decided to write a blog post about it. Question was: I have a SQL logins: Login1 and Login2. I gave ALTER LOGIN permission on Login1 to Login2 so that Login2 can change the password for Login1. But when......
|
|
-
|
|
SQL Server Denali brings us new string function, FORMAT function. It will make formatting of date/time and number values easier.
Syntax: FORMAT (value, format [,culture])
Formatting Date/Time
Let’s see how it works:
DECLARE @a datetime = getdate()
-- If the culture argument is not provide......
|
|
-
|
|
CONCAT() is new string function in SQL Server Denali. It returns a string that is the result of concatenating two or more string values (or values that can be converted to string).
Syntax: CONCAT (string_value1, string_value2 [, string_valueN ] )
With CONCAT function, you can concatenate between 2......
|
|
-
|
|
SQL Server Denali introduced 2 new logical functions: IIF and CHOOSE.
IIF function
IIF function returns one of two values, depending on whether Boolean expression evaluates to true or false.
Syntax: IIF (boolean_expression, true_value, false_value)
IIF function is simple replacement for:
Case ......
|
|
-
|
|
SQL Server Denali introduces 7 new date and time built-in functions. One of these functions is EOMONTH(). EOMONTH() returns the date value that represents the last day of the month for given date.
Syntax: EOMONTH( start_date [, months_to_add] )
Pre- Denali, to calculate the date value that represe......
|
|
-
|
|
TRY_CONVERT is new conversion function in SQL Server Denali. Unlike the CAST and CONVERT functions, TRY_CONVERT allows us to test whether it is possible to convert a value to specific data type.
TRY_CONVERT converts passed value to the specified data type, if conversion isn’t possible null is retur......
|
|
-
|
|
SQL Server Denali introduced new conversion functions: PARSE() and TRY_PARSE().
PARSE() function
PARSE() function converts expression (string value) to date/time and number data types if conversion is possible. If conversion isn’t possible it raises an error.
-- Parse to datetime specifying cul......
|
|