|
|
-
|
|
As you know I have started a new series on "Exploring SSMS" by which I will be posting some features that are available in SSMS which will be very helping during the development. In this post we will see how to make use of the option “Search i...
|
|
-
|
|
I saw this question
"Date d = new SimpleDateFormat("MM/dd/yyyy").parse("22/44/2008") will return Nov 13, 2009 as the date! Really? 22 is what month?"
The code is written in Java and the user is surprised to see the result and wonders if 22 is a month.
...
|
|
-
|
|
Well. You can express numbers in scientific form. ExampleSELECT 2E
returns 2 SELECT 3E
returns 3
Now what does the following select statement return?SELECT 2E-3ETRY to answer this question without running it....
|
|
-
|
|
I have posted a question for July 2012 at Question of the month July 2012 - How does COALESCE(null,null+1,null) work? Did you know why the second query works without any error?
A NULL value can be of two types. Typed NULL and non-Typed NULL.
SELECT SUM...
|
|
-
|
|
27 then 28 else day_col+1 end
GO
Now Enable Statistics time and compare the time taken by each method SET STATISTICS TIME ON
print '======================================================'
Print 'Method 1 starts'
print '===============================...
|
|
-
|
|
DateSerial function accepts three paramter values year,month and day and return a valid date value with time set to midnight. SQL Server does not support this function until version 2012 is released.
There can be many ways to simulate this functionality...
|
|
-
|
|
As you know COALESCE function returns the first non NULL value from the list.
When you execute the followingselect coalesce(null,null,null)
you will get the following error Msg 4127, Level 16, State 1, Line 1
At least one of the arguments to COALESCE mu...
|
|
-
|
|
I have posted about Creating DATETIME value from integer DATE and integer TIME where I have shown you various methods to create datetime value from integer date and time. Well. Did you know that in MSDB database there is a system function named agent_da...
|
|
-
|
|
System table sysjobschedules from MSDB database has four columns schedule_id, job_id, next_run_date and next_run_time. The datetime value is splitted into two columns next_run_date and next_run_time in the form of integers with the format YYYYMMDD and H...
|
|
-
|
|
Often you may come across a situation to calculate time values which are stored as numbers. There is a seperate TIME datatype to store time values starting from SQL Server 2008. But you might find that in earlier versions time values might be stored in ...
|
|