|
|
-
|
|
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 ...
|
|
-
|
|
There is a blog post about #TSQL CAST Conversion Error… give me the row please! where the posted showed some methods to identify the data where convertion error happens. Here are other approaches to identify the problamatic data. Consider the following ...
|
|
-
|
|
Often you see people complaining that although the file exists in the directory, the code throws an error Operating system error 2(The system cannot find the file specified.). Ok. The following need the file path to be specified in the code
1 Backup/Res...
|
|
-
|
|
My friend asked me to come up with very triky interview question which is not usually asked. I myself asked this question to some of candidates while interviewing. It is possible to to apply arithmetic operators + and - on date columns like Date+2, Date...
|
|
-
|
|
Pinal Dave, Blogger,Speaker,Evangelist and Author,in his blog posted a puzzle about SQL SERVER – A Puzzle – Swap Value of Column Without Case StatementConsider the following set of data USE tempdb
GO
CREATE TABLE SimpleTable (ID INT, Gender VARCHAR(10...
|
|
-
|
|
Both SET and SELECT clauses can be used to assign values to the variables. While SET works for a single variable, SELECT works for more than a variable. If you want to assign values to multiple variables in single shot, SELECT can be used.
SELECT serv...
|
|