Viewing 15 posts - 2,776 through 2,790 (of 14,953 total)
I've ground up a hard drive with a power-grinder (grinding wheel, whatever), and I've melted one down with a welding torch. Was fun both times, but you do have...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 22, 2011 at 6:27 am
Dev (11/22/2011)
I think it's the right place to throw my question once again... 'Why 2 Cents'... (I will start a new thread soon...)
It used to be "penny for...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 22, 2011 at 6:20 am
sql:variable and sql:column can return values, but not paths. To use it that way, you need to build a dynamic SQL statement that puts the literal path in the...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 21, 2011 at 2:08 pm
Revenant (11/21/2011)
DECLARE @temp TABLE ( name VARCHAR(20), total INT );
INSERT INTO @temp
SELECT Name, SUM(Consumption)
FROM tablename
GROUP BY Name;
DECLARE @maxValue INT = ( SELECT MAX(total) FROM @temp );
SELECT...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 21, 2011 at 12:43 pm
Here's a solution that doesn't use a Calendar table:
CREATE PROC dbo.DeleteMe
(@WeekDay INT,
@FromDate DATE,
@ToDate DATE)
AS
...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 21, 2011 at 12:16 pm
Revenant (11/21/2011)
bomborde (11/21/2011)
. . .
Can anyone do this without a 'view' or 'join' or 'order by'? . ....
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 21, 2011 at 12:03 pm
Second the motion on using a calendar table. They're tremendously useful, and will be MUCH faster than the kind of function you built.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 21, 2011 at 11:56 am
bomborde (11/21/2011)
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 21, 2011 at 11:54 am
It must be DBA season somewhere. That's four admitted interview questions just today on the forums. And those are just the ones who fessed up.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 21, 2011 at 11:37 am
Honestly, I'd use Top 1 With Ties, use an appropriate Order By on the Sum() function, and let the interviewer know that you got some help online to make sure...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 21, 2011 at 11:34 am
This page has definitions: http://msdn.microsoft.com/en-us/library/ms139914.aspx
Do you have specific questions, or are you just trying to figure out which one is which?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 21, 2011 at 11:19 am
Not without an Order By, but a simple Sum() and Order By would do it. Do that all the time.
Is it a homework/test/interview type question, where artificial constraints like...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 21, 2011 at 9:39 am
Ninja's_RGR'us (11/21/2011)
GSquared (11/21/2011)
Brandie Tarvin (11/21/2011)
And it just happened at work."But we're using NOLOCK in this stored procedure. How could it have gotten killed due to a deadlock?"
<headdesk><headdesk><headdesk>
Cargo Cult programming. ...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 21, 2011 at 9:36 am
Brandie Tarvin (11/21/2011)
And it just happened at work."But we're using NOLOCK in this stored procedure. How could it have gotten killed due to a deadlock?"
<headdesk><headdesk><headdesk>
Cargo Cult programming. Gotta love...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 21, 2011 at 9:26 am
Jack Corbett (11/21/2011)
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
November 21, 2011 at 9:25 am
Viewing 15 posts - 2,776 through 2,790 (of 14,953 total)