You work as a SQL Server 2012 database developer at ABC.com. ABC.com has a database
named SalesDB.
You are developing a stored procedure that takes a parameter named @date that uses the
varchar datatype. The @date parameter must be compared to the value in a datetime column
named OrderDate.
Which of the following WHERE clauses would be the most efficient WHERE clause to use?
A.
WHERE OrderDate = CAST(datetime,@date)
B.
WHERE OrderDate = CONVERT(datetime,@date)
C.
WHERE OrderDate =@date
D.
WHERE OrderDate = CAST(@date AS datetime)
E.
WHERE OrderDate = PARSE(@date AS Date)
Explanation:
I think C is the answer
The answer is incorrect The correct answers are B,C,D but the most efficient will be B
http://www.mssqltips.com/sqlservertip/3018/performance-comparison-of-the-sql-server-parse-cast-convert-and-tryparse-trycast-tryconvert-functions/
Looks like B is the most efficient. I would have guessed CAST, but looks like I was wrong.
D
?
Although web sites we backlink to below are considerably not associated to ours, we really feel they’re in fact really worth a go through, so have a look.
usually posts some pretty intriguing stuff like this. If you are new to this site
Every once in a when we select blogs that we read. Listed below are the most up-to-date sites that we choose
The facts talked about inside the article are several of the ideal available
here are some hyperlinks to web-sites that we link to mainly because we think they may be really worth visiting
although web-sites we backlink to below are considerably not associated to ours, we feel they’re truly worth a go through, so have a look
we came across a cool site which you might love. Take a appear in the event you want
please visit the web pages we comply with, which includes this 1, because it represents our picks in the web
Here are some of the internet sites we recommend for our visitors
Here is an excellent Blog You may Uncover Intriguing that we encourage you to visit.
Sites of interest we have a link to
The information and facts mentioned within the article are a few of the most beneficial out there
we like to honor many other internet web pages around the internet, even if they arent linked to us, by linking to them. Under are some webpages worth checking out
Every when in a whilst we pick out blogs that we read. Listed below are the most recent websites that we pick
Sites of interest we’ve a link to
one of our guests a short while ago suggested the following website
here are some links to internet sites that we link to mainly because we feel they’re really worth visiting
The data mentioned within the write-up are a number of the best offered
Every as soon as in a though we pick blogs that we read. Listed below would be the latest sites that we pick out
below youll obtain the link to some websites that we consider it is best to visit
Here is an excellent Weblog You might Uncover Exciting that we Encourage You
Wonderful story, reckoned we could combine several unrelated data, nonetheless truly really worth taking a look, whoa did a single find out about Mid East has got more problerms at the same time
check beneath, are some totally unrelated websites to ours, nevertheless, they are most trustworthy sources that we use
we like to honor lots of other online websites on the net, even when they arent linked to us, by linking to them. Below are some webpages worth checking out
one of our visitors not too long ago encouraged the following website