|
|
-
|
|
Brent Ozar, a SQL Server MCM and MVP, posted about Top 10 SQL Server DBA Interview Questions. The question no 10 is about solving FizzBuzz problem. The FizzBuzz problem is described as
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead......
|
|
-
|
|
One of my friends asked me to ask him a very different and tricky interview question. I asked him to come up with the code that passes parameter to getdate() function ie use any code where getdate(something) is part of the code. Although it is very interesting he did not come up with an answer. Here......
|
|
-
|
|
In this blog post, I explained different uses of GO command
Here is a Fun when you use GO as object name
CREATE PROCEDURE GO
(
@I INT
)
AS
SELECT @I AS number
Well. The procedure is created and let us try to execute
GO 2
What we see is
Command(s) completed successful......
|
|
-
|
|
RAND function in SQL Server is used to generate a random value between 0 and 1. When you use RAND in the SELECT statement, it generates the same value for the entire resultset. One of my friends asked me if it is possible to have different random values...
|
|
-
|
|
I have posted a post on Different ways to find End of the month where I showed you five different ways to find out last day of a month. Here is the analysis on how long each method takes to executeI am not using any physical table to store dates and the...
|
|
-
|
|
Following up Question of the month December 2012 - Why is last comma ignored in CREATE TABLE statement? , here is same question on TABLE VARIABLE
The last comma in permenant and temporary tables are ignored when you run the followingCREATE TABLE emp(emp...
|
|
-
|
|
SEQUENCE is introduced in version 2012. It is an object which can be used to generated customised SEQUENCE numbers that be used across many objects in the database. A SEQUENCE can be directly/indirectly bound with objects.
Consider the following SEQUEN...
|
|
-
|
|
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 '===============================...
|
|
-
|
|
There was a question in the forums where a user asked for a solution to find out the number which is succeeded by the last 0 in that number
For example, in numbers like 10807023 and 1000508, 23 and 8 are the numbers which are succeeded by the last 0 of...
|
|
-
|
|
The currency symbol $ represents the value 0. Find more examples at http://beyondrelational.com/modules/1/justlearned/tips/8577/arithmetic-operations-with-.aspx
The datatype of the returned value from $ is money.
Consider the following exampledeclare @...
|
|