Viewing 15 posts - 241 through 255 (of 311 total)
Oops I didn't realize I was in the SQL 2000 forum. I came her via Active Threads and thought it was the T-SQL 2005 forum.
I don't have access to a...
October 29, 2009 at 6:36 am
Glad I could help. If you want to improve it, replace the query on the system view by a persistent table. That may speed up things a little.
Peter
Edit: didn't saw...
October 29, 2009 at 6:12 am
Like this?
select
dateadd(dd, c.n - 1, t.StartDate) Date, t.EventID
from
#test t
cross apply
(
select top(t.Duration)
row_number() over (order by name) n
...
October 29, 2009 at 5:58 am
Thanks Bob. I just expected the pivot solution to require far less coding in the case of 30 column pairs. But even that doesn't seem to be the case, now...
October 28, 2009 at 7:18 am
A nice and surprising solution by Bob (it took me some time to see where c1 in left(c1, 7) was coming from). All I could come up with was:
select
...
October 28, 2009 at 4:36 am
I used the Profiler while refreshing the System Databases branch in the Object Explore of SSMS and the following (partial) statement came along:
SELECT
dtb.name AS [Database_Name]
/* More...
October 28, 2009 at 3:55 am
Try
SELECT
ID, Seq
FROM
Sequence
WHERE
Seq = REPLICATE('1', LEN(Seq))
Peter
August 31, 2009 at 4:45 am
You don't have to envy me. Based on the figures you posted, obviously this machine is making me producing very slow code, although I have not figured out yet what...
August 26, 2009 at 1:06 pm
Would someone please doublecheck my results? For comparison, Peter's original code is shown in a slightly modified version below. It now takes the sequence string as...
August 26, 2009 at 11:19 am
You can set the hidden property of the Phone TableColum (select the entire column, not just the header or detail cell) to an expression:
=IIf(CountDistinct(Fields!Phone.Value) = 0, True, False)
Peter
August 26, 2009 at 1:12 am
Thanks Bob.
BTW, I figured out wat was wrong with using a CTE to generate the Tally table. It was the final SELECT ... FOR XML PATH('') which ruined the order.
Here's...
August 25, 2009 at 3:51 pm
Indeed a challenging question, so I gave it a shot too. I'm also curious about the purpose of the output, because it seams at least as complicated to process in...
August 25, 2009 at 2:57 pm
I don't think that just casting the UserID to varchar will work, because in this way UserID '2' will become before UserID '11', when sorted desc. You have to properly...
August 25, 2009 at 11:53 am
Use "Add Existing Item" instead of "Add Existing Package". It will not make a copy of the package.
Peter
August 24, 2009 at 12:10 am
If temp1 contains duplicates, you will get the error. Try using distinct
insert into emails(email) select distinct t.email from temp1 t
left outer join emails e on e.email = t.email...
August 5, 2009 at 12:58 am
Viewing 15 posts - 241 through 255 (of 311 total)