Viewing 15 posts - 1,351 through 1,365 (of 2,007 total)
Usman Butt (11/17/2011)
DECLARE @StartDate DATETIME, @EndDate DATETIME, @MonthDiff INT
SELECT @StartDate = '20091001', @EndDate =...
November 17, 2011 at 3:44 am
Use a calendar table. I've done one on the fly here, for performance you'd be better off with a real table.
DECLARE @FromDate DATETIME = '2011-08-10',
@ToDate DATETIME = '2011-10-31'
;WITH t1...
November 17, 2011 at 3:19 am
TheSQLGuru (11/16/2011)
November 17, 2011 at 2:19 am
Cursors are bad, blah blah etc etc.
Now that's over with, can you just build the string dynamically? Like this -
FETCH FIRST FROM SuffixesCursor INTO @WhichSuffix
WHILE @@Fetch_Status = 0
BEGIN
EXEC ('Update...
November 16, 2011 at 10:10 am
SELECT SetID, SubSetID, STUFF((SELECT ' ' + TextMessage
...
November 16, 2011 at 10:08 am
47 minutes 31 seconds later. . . š
========== Ensure Table is ready ==========
================================================================================
========== Insert 500,000,000(!!) rows ==========
================================================================================
========== Add Index ==========
================================================================================
========== Delete 1 ID - 485,001,270 ==========
================================================================================
========== Queries!! ==========
================================================================================
========== BASELINE ==========
Table...
November 16, 2011 at 9:36 am
TheSQLGuru (11/16/2011)
November 16, 2011 at 8:39 am
Donald Bouchard (11/16/2011)
November 16, 2011 at 7:08 am
rahu21 (11/16/2011)
Celko's solutions both are beyond all affairs, not only presenting wrong results, but also excruciatingly slow.
#testEnvironment without Index: Tally beats my RowNumber
#testEnvironment with Index: my RowNumber beats Tally
Never give...
November 16, 2011 at 6:19 am
CELKO (11/15/2011)
November 15, 2011 at 1:47 am
Jako de Wet (11/15/2011)
I have a xls sheet with values like this:
9780431016191 DHodge
9780431016771...
November 15, 2011 at 1:14 am
SanDroid (11/14/2011)
Ninja's_RGR'us (11/14/2011)
so aside...
November 14, 2011 at 8:44 am
Mark-101232 (11/14/2011)
What XML are you trying to generate?
Let me start again, because I'm sure that I'm attempting to over-complicate this with my lack of XML knowledge.
Take this XML: -
<Message>
...
November 14, 2011 at 7:57 am
Mark-101232 (10/5/2011)
DECLARE @x XML
SET @x='<MessageDelivery version="B000">
<ReturnMessage id="3652789340">
<AdC ocean="PACCGL">4815044</AdC>
<MessageStatus code="100" time="2011-09-25 13:43:22">status ok</MessageStatus>
<MessageData>700A20000018C0375494400000</MessageData>
<Flags les="0" app="0" read="1" />
</ReturnMessage>
</MessageDelivery>
'
SELECT x.r.value('local-name(.)','VARCHAR(20)') AS Element,
x.r.value('./text()[1]','VARCHAR(20)')...
November 14, 2011 at 4:52 am
carl.meads (11/14/2011)
SELECT #callhandling2.client
,#callhandling2.daycat+' '+#callhandling2.timecat as [Category]
,Sum(#callhandling2.calls) as [Total Calls]
,[Calls Per 30 Mins] = Case
When #callhandling2.daycat+' '+#callhandling2.timecat='Weekend 20:00-08:00' then if(iserror(Sum(#callhandling2.calls)/2208.0)),0,Sum(#callhandling2.calls)/2208.0
When #callhandling2.daycat+' '+#callhandling2.timecat='Weekend 08:00-20:00' then Sum(#callhandling2.calls)/2208.0
When #callhandling2.daycat+' '+#callhandling2.timecat='Weekday...
November 14, 2011 at 4:02 am
Viewing 15 posts - 1,351 through 1,365 (of 2,007 total)