Viewing 15 posts - 676 through 690 (of 897 total)
Quatrei.X (8/26/2010)
:hehe: I was planning to create a generic function which gets a comma separated list of words in a string and use CTE to seperate those strings to table...
August 26, 2010 at 3:50 am
Yes. You can surpass the limit by setting the value for MAXRECURSION as 0.
OPTION (MAXRECURSION 0)
But always make sure you don't go into an infinite loop by using this option.
August 26, 2010 at 3:37 am
Try using NOT EXISTS. It might reduce the Number Of Reads.
DELETE
FROM RPF RO WITH (ROWLOCK)
WHERE RO.U_S = 'PPP'
AND RO.e_d = '20100811'
AND NOT EXISTS ( SELECT * FROM RPF RI WITH...
August 25, 2010 at 11:35 am
One alternative could be this
;WITH MyCte AS
(
SELECTROW_NUMBER() OVER( ORDER BY CASE
WHEN @sortOrder = 1 THEN CapId
WHEN @sortOrder = 2 AND Area < 2000 THEN 3 -- Say 3 for Small
WHEN...
August 25, 2010 at 6:38 am
Jeff Moden (8/23/2010)
Kingston Dhasian (8/23/2010)
But i mostly use this method to write a quick query. It is short and sweet.
... and slow. Heh... I normally want the highest speed...
August 23, 2010 at 7:07 am
Jeff Moden (8/22/2010)
Kingston Dhasian (8/22/2010)
One more solution to your problem
SELECT * FROM holidays WHERE DATEDIFF( DAY, freedate, GETDATE() ) = 0
The below mentioned article might be helpful to you
Ummm... no....
August 23, 2010 at 12:20 am
One more solution to your problem
SELECT * FROM holidays WHERE DATEDIFF( DAY, freedate, GETDATE() ) = 0
The below mentioned article might be helpful to you
August 22, 2010 at 2:45 am
varshini (8/19/2010)
can you expline me how to use the simple query to achive this ?
If people start giving you the solutions directly you will not learn. Wayne has given you...
August 19, 2010 at 6:54 am
Can't think of an easy solution for this. Lets see if somebody comes up with a quick solution. I will try it myself in my free time.
August 16, 2010 at 3:16 am
This is enough to give you the required answer. No need of UNION with the other statement.
SELECT EmpID, MIN(startdate),MAX(ISNULL(enddate,Getdate())) As EndDate FROM Duration
group by EmpId
August 16, 2010 at 12:00 am
To see the execution plan, you can select the option Query -> Include Actual Execution Plan. Now if you run the SELECT query you will see the Execution Plan after...
August 12, 2010 at 6:29 am
If you see the Execution Plan for the query, the picture will be clear. The WHERE Clause is actually evaluated before your SELECT Clause and the ORDER BY Clause. Hence...
August 12, 2010 at 5:59 am
The link below will be helpful for these type of problems
August 12, 2010 at 4:15 am
You can use a ROW_NUMBER() for the same. Have a look at it in Books Online.
SELECTa_id, expense, b_id, CASE WHEN RowNum = 1 THEN amount ELSE 0 END amount
FROM(
SELECTROW_NUMBER() OVER(...
August 12, 2010 at 3:54 am
You can do it like this
SELECTScheduledTime
FROMSchedule
ORDER BY CASE ScheduledTime
WHEN 'Morning' THEN 1
WHEN 'Afternoon' THEN 2
WHEN 'Evening' THEN 3
END
August 12, 2010 at 3:41 am
Viewing 15 posts - 676 through 690 (of 897 total)