Viewing 15 posts - 3,106 through 3,120 (of 3,396 total)
So in theory they could merge two records that don't match? Could you post an example? Explain why you can't do it with either a CTE or a...
January 10, 2014 at 6:28 pm
Cursor is a bad word around here... careful.
That said, I don't think you need a cursor at all.
CREATE Table #TableA
(
ID int IDENTITY(1,1),
SID INT,
FNAME varchar(50),
LNAMEvarchar(50),
DOB date,
CITYvarchar(50),
IsActive bit
);
GO
INSERT INTO #TableA
VALUES ('245','Smith','John','1/10/1998','Los Angles','0');...
January 10, 2014 at 6:02 pm
Made a little progress. I added some columns just to understand what's going on (since I'm sort of stumbling around in the Dark Ages). Here's my latest attempt:
DECLARE...
January 9, 2014 at 6:50 pm
What's the maximum number of cycles? Can they overlap? Presumably you want a datetime on each symptom row?
As best I can remember, protocols run for a non-predetermined period of...
January 9, 2014 at 3:35 pm
Correct. It's modeling cancer treatment therapy, so sometimes they get fatal complications, and after that you can't test them anymore. (Cheery huh?)
January 9, 2014 at 12:39 pm
Okay, I re-read SQLKiwi's articles on APPLY. Basically, the "left" side is the set of enrollees to "process", and the right side is the symptoms. Got that part....
January 9, 2014 at 10:29 am
Cruel Taskmaster <g>,
I have a dumb question - if I use a non-looping solution, how do I indicate that no more treatment cycles should be added for an enrollee after...
January 9, 2014 at 9:06 am
I probably am skipping a class. The challenge I couldn't get around was this one:
the "continue adding treatment cycles (groups of "symptom" records) until either an enrolled patient has...
January 9, 2014 at 5:56 am
How about a couple of things -- code we can read, and some sample data? (CREATE TABLE script(s) and INSERTs). And while I'm being demanding, how about an example...
January 9, 2014 at 1:20 am
Thanks for the ideas, everybody.
I got it to work, which is good, but I had to resort to <whisper>a dreaded cursor.</whisper> I know, it's a total cheat, but I'm...
January 8, 2014 at 9:28 pm
SELECT Contact_ID, Student_ID, Contact_txMail
FROM dbo.Contact
where Student_ID in ( select Enroll_status, Student_ID
from dbo.Student_Info
where Enroll_status = 'true');
So you only want a single record from Contact for each StudentID?
SELECT Contact_ID, Student_ID,...
January 7, 2014 at 4:52 pm
INTERSECT should be equivalent to INNER JOIN, as any non-matching values fall out of the result.
January 6, 2014 at 7:33 am
EXCEPT and INTERSECT were added in SQL2005.
January 5, 2014 at 11:11 pm
The other way to do it is to use a Matrix in SSRS. You could base your report on a stored procedure that accepts the date range you want...
January 5, 2014 at 7:31 pm
Grant Fritchey has posted at least a few database maintenance videos on YouTube. Definitely worth watching if you're not really comfortable with backup/restore. Absolutely something to practice at...
January 5, 2014 at 7:24 pm
Viewing 15 posts - 3,106 through 3,120 (of 3,396 total)