Viewing 15 posts - 91 through 105 (of 938 total)
Jeff Moden (7/1/2010)
Mike C (7/1/2010)
Jeff Moden (7/1/2010)
Mike C (7/1/2010)
July 2, 2010 at 7:36 pm
UMG Developer (7/1/2010)
Mike C (7/1/2010)
UPDATE t
SET ...
FROM table t
INNER JOIN table2 t2
ON ...
This syntax lends itself to parallelism and can result...
July 1, 2010 at 1:59 pm
Goldie Graber (7/1/2010)
Mike C (7/1/2010)
July 1, 2010 at 9:51 am
Jeff Moden (7/1/2010)
Mike C (7/1/2010)
July 1, 2010 at 7:33 am
Good catch on the week # UMG. As you mentioned, I did assume 2005 or 2008, but only because 2000 is out of support :). If using 2000, he...
July 1, 2010 at 6:27 am
Hi mutlyp,
I took a shot at rewriting this in cursor-less form. There are some things to keep in mind:
* You'll probably need to review some of the logic (I've...
June 30, 2010 at 8:05 pm
The last I heard on the topic of temp tables v table variables was that the server decides when it can use memory v serializing to disk. I only...
June 30, 2010 at 2:03 pm
chris.fauvel (6/30/2010)
Bradley Deem (6/29/2010)
June 30, 2010 at 9:50 am
Jeff Moden (6/30/2010)
The next thing we need to teach is that returning results to the...
June 30, 2010 at 9:20 am
I didn't get a chance to run any tests against the data (it was a little late when I posted that), but one thing worth considering is whether or not...
June 30, 2010 at 5:57 am
mutlyp (6/29/2010)
You have the Insert in front of the select. Is that on purpose? I guess what I am asking is, if you put an Insert statement...
June 29, 2010 at 9:33 pm
How's this for data? 🙂
CREATE TABLE #Role
(
RoleName VARCHAR(100)
);
GO
INSERT INTO #Role
(
RoleName
)
VALUES ('Accounting'), ('Approver'), ('Developer'), ('International Sales Manager'), ('Marketing'), ('System Administrator'),
('Technical Customer'), ('Technical Director'), ('Training');
GO
CREATE TABLE #UserRole
(
UserID INT NOT NULL,
RoleName VARCHAR(100)...
June 29, 2010 at 9:10 pm
mutlyp (6/29/2010)
June 29, 2010 at 8:15 pm
WITH CTE
AS
(
SELECT ROW_NUMBER() OVER
(
PARTITION BY u2.UserID
ORDER BY MIN(u2.RoleAssignedDate)
) AS RowNum,
u2.UserID,
u2.RoleName
FROM @UserRole u2
GROUP BY u2.UserID,
u2.RoleName
)
SELECT DISTINCT u1.UserID,
SUBSTRING
(
(
SELECT ', ' + c.RoleName AS '*'
FROM CTE c
WHERE u1.UserID = c.UserID
ORDER...
June 28, 2010 at 11:20 pm
lehmannds (6/27/2010)
togaratw (6/26/2010)
I'm eagerly anticipating the next series of this article for more complicated scenarios where cursors can...
June 27, 2010 at 2:42 am
Viewing 15 posts - 91 through 105 (of 938 total)