Viewing 15 posts - 2,686 through 2,700 (of 3,957 total)
😀
ChrisM@Work (9/28/2012)
dwain.c (9/27/2012)
I think this is a pretty snappy query too.
;WITH Tally (n) AS (
SELECT TOP (SELECT 1+MAX(DATEDIFF(day, StartDate, EndDate)) FROM #RoomDates)
...
October 1, 2012 at 12:00 am
This article by Jeff Moden gives you arguably the best way to approach the running totals problem:
September 30, 2012 at 11:51 pm
Jeff Moden (9/28/2012)
September 30, 2012 at 11:39 pm
only4mithunc (9/30/2012)
I'm getting the answer with that code. I'm just trying to see if I can rewrite this some way so that I don't have to hard code my...
September 30, 2012 at 7:52 pm
coronaride (9/27/2012)
September 27, 2012 at 10:31 pm
Jeff Moden (1/16/2011)
Sachin Nandanwar (1/16/2011)
September 27, 2012 at 10:26 pm
The next thing I would try is to SELECT the problematic SQL out to the Results pane in SSMS, copy/paste it into an Execute window, run it there and see...
September 27, 2012 at 9:59 pm
How are you executing the SQL?
1. EXEC
2. sp_executesql
I've used #2 with VARCHAR(MAX) strings (that contained > 8000 chars) before with no problem.
September 27, 2012 at 9:29 pm
I confess I haven't thoroughly read this entire thread but I don't think this approach was covered.
DECLARE @Test NUMERIC(5,4) = 1.55
SELECT REPLACE(REVERSE(0.+CAST(REVERSE(@Test + 0.) AS FLOAT)) COLLATE Latin1_General_BIN, '.', '')
I...
September 27, 2012 at 8:28 pm
Are you looking for something like this?
;WITH XMLParser AS (
select x.[desc].value('.','varchar (230)') as [desc]
, y.[desc].value('(./String)[1]','varchar (230)') as [path]
...
September 27, 2012 at 8:00 pm
Here's another, relatively straightforward approach:
;WITH ApplicationsGrouped AS (
SELECT ComputerName
,Applications=STUFF((
...
September 27, 2012 at 7:39 pm
Another way is like this (a computed column):
IF object_id('TempDB..#tTemp1') IS NOT NULL
DROP TABLE #tTemp1
CREATE TABLE #tTemp1(ID int, Name varchar(20)
,Comment AS ('The city name is ' +...
September 27, 2012 at 7:13 pm
OMG! :w00t:
I must have read this article 5 times at least and I never could quite get a grip on it.
Finally, I've been able to apply it to a real...
September 27, 2012 at 7:07 pm
Phil,
I think this is a pretty snappy query too.
;WITH Tally (n) AS (
SELECT TOP (SELECT 1+MAX(DATEDIFF(day, StartDate, EndDate)) FROM #RoomDates)
...
September 27, 2012 at 6:55 pm
Grant Fritchey (9/27/2012)
THREADIZENS!Who is going to make it to any of the SQL in the City events coming up in the next week+?
If you ever get around to having one...
September 27, 2012 at 6:16 pm
Viewing 15 posts - 2,686 through 2,700 (of 3,957 total)