Viewing 15 posts - 1,846 through 1,860 (of 3,482 total)
If it's for a single stored procedure, wouldn't you just use WITH OPTION RECOMPILE?
July 21, 2016 at 10:21 pm
At first I thought using DelimitedSplit8K would work for this... but I guess I didn't read the fine print carefully enough.
That will happen at 1:30 in the morning sometimes!
July 20, 2016 at 12:27 am
Here's a good article to read that you can adapt to answer your question:
http://dba.stackexchange.com/questions/86415/retrieving-n-rows-per-group
At least then you can give it a try and report back if you have problems. Helping...
July 19, 2016 at 11:36 pm
Is this close?
-- create a cursor to loop over this result set
/* create a cursor to loop through each table... */
DECLARE @CmdLine AS NVARCHAR(200);
DECLARE @CmdCursor AS CURSOR;
SET @CmdCursor = CURSOR...
July 18, 2016 at 9:46 pm
After taking Jeff's advice...
maybe this works?
SELECT Country
, AccountNum
, PolicyNum As CurrentPolicy
, LAG(PolicyNum,1) OVER (PARTITION BY Country, AccountNum ORDER BY PolicyEffDt) AS PrevPolicy
FROM @PolicyRelationship
ORDER BY Country
,AccountNum;
July 18, 2016 at 7:19 pm
Nothing to it
SELECT * FROM #TEMP
ORDER BY NEWID();
NEWID() generates a random number for each record, so sorting by it causes a "random" sort.
July 18, 2016 at 5:25 pm
This would be a much clearer question if you included sample data (create table scripts, insert scripts) and expected results.
July 17, 2016 at 8:14 pm
I could rewrite the code this way...
SELECT personID
FROM #gradPerson AS g
WHERE NOT EXISTS (SELECT TC.PersonID
FROM TranscriptCourse AS tc
WHERE tc.PersonID = g.PersonID
Are you saying you don't understand...
July 17, 2016 at 12:39 pm
What? I don't understand your question.
You've been here way too long to post questions like you do. No data, no table structures, nothing. As such, all I can do...
July 15, 2016 at 11:57 pm
CREATE TABLE scripts? INSERT scripts with dummy data? Lots easier to sort out with at least something to work with. Without that I can only hazard a guess.......
July 15, 2016 at 5:57 pm
Kevin,
Does your computer automatically play Pink Floyd whenever you're forced to work on it...? The till working in the background might be good incentive...
July 15, 2016 at 5:07 am
You can insert a row below the matrix outside the group and put the total there, and it will only show on the last page.
Right-click on the matrix/tablix, and in...
July 12, 2016 at 9:59 am
You're describing a matrix. You can add a totals column if you wish as part of the matrix.
July 12, 2016 at 8:10 am
I agree, but then it's not my homework. If you want good help, provide create table scripts etc.
July 12, 2016 at 8:09 am
Sorry, the more I read this, the more odd it sounds. Are you stuck with this table design? It just sounds a little off. I'm not sure i...
July 11, 2016 at 3:12 pm
Viewing 15 posts - 1,846 through 1,860 (of 3,482 total)