Viewing 15 posts - 31 through 45 (of 64 total)
'trivial piece of code', yes, if you speak pivot 😛
I modified your code a bit (removed the expensive join with ShiftsTable) and got this:
select ShiftStartDate, dateadd(hour, 8, ShiftStartDate) ShiftEndDate, [11],...
October 24, 2011 at 12:50 am
OK, I rewrote my question. Hope it is clearer now.
October 23, 2011 at 1:43 pm
OK, you probably mean something like this:
;with temp as (
select row_number() over (order by checksum(newid())) Id, c1, c2, c3
from #Table2
)
select *
from #Table1...
January 27, 2011 at 8:51 am
Thanks Vedran, the trick with row_number and cross join works great 🙂 I did it this way:
;with temp as (
select top 1000 row_number() over (order by...
January 27, 2011 at 6:29 am
Thanks Vedran, but this isn't quite the solution I was looking for.
Some other facts:
- Table1 is created and populated from another application, only columns c1, c2, c3 (in reality up...
January 27, 2011 at 12:22 am
Maybe you could use something like this:
select substring(LEFT(@exampleString, Charindex('<leadId>', REPLACE(@exampleString, ' ', ''))), Charindex('<reason>', REPLACE(@exampleString, ' ', '')), LEN(@exampleString))
We don't need to know the length because from the documentation:
If the...
January 11, 2011 at 3:45 pm
Grant Fritchey: what kind of errors could occur in the initiation of the transaction?
Reji: and where is the difference?
January 9, 2011 at 12:48 pm
... but extremely slow on big tables though, probably because of cross join...
August 18, 2010 at 5:55 am
Works great, thanks!
And the article goes to my to-do list 🙂
August 18, 2010 at 5:28 am
OK,
I created a stored procedure with only one parameter (comma delimited) and used Jeff Moden's parsing technique.
Thanks
May 3, 2010 at 6:29 am
One option could be, that I always call the procedure with 2 parameters (table name, list of columns):
exec CheckProcedure('Game01', 'column1, column2, column3')
But each column as it's own parameter would be...
April 30, 2010 at 2:38 pm
OK, a procedure then.
It's about lottery. Each lottery game can have different parameters about winning numbers. One such parameter is 'number of numbers you have to select'. So if the...
April 30, 2010 at 11:56 am
Works great, I just had to change definition of cteFullRange to:
Select right('000000000000' + convert(varchar, number), 12)
from master..spt_values
where TYPE='p' and number between...
September 16, 2009 at 1:30 am
Viewing 15 posts - 31 through 45 (of 64 total)