Viewing 15 posts - 3,721 through 3,735 (of 3,956 total)
First off, why is this an SSIS job? Seems to me like a simple SP run by SQL Server agent could locate employees based on their hire date, then...
April 24, 2012 at 7:27 pm
My crystal ball tells me:
1. You're calling this function in a loop.
2. In that loop, you're creating each of the target column values in a separate @ local variable
3. At...
April 24, 2012 at 7:19 pm
Homework problem or not, that's one quirky update:
DECLARE @seq TABLE (
pkid int not null primary key,
seqId int null,
amount decimal (10,2) not null,
dt datetime not null)
DECLARE @MaxSeqID INT, @total INT
INSERT INTO...
April 24, 2012 at 7:03 pm
Polkadot - Hello again!
This is a minor adaptation of a solution I posted in another thread just a couple of days ago:
http://www.sqlservercentral.com/Forums/Topic1288432-392-1.aspx#bm1288618
Try this:
DECLARE @t TABLE (words VARCHAR(max))
INSERT INTO @t
SELECT...
April 24, 2012 at 6:35 pm
Cadavre,
Funny you should mention performance of SUM() OVER. I just happen to use this for the first time today (where's the blushing smiley when you need him?) and got...
April 24, 2012 at 9:34 am
I think you've gotten the idea.
Don't wait for us to desk check it. Run the SELECT (maybe with a TOP 100 or something) and look at the output results....
April 24, 2012 at 6:54 am
Jared + John,
I can see where you're headed and I'm almost there. The idea of doing away entirely with derived columns in SQL is revolutionary, not to mention imaginitive!...
April 24, 2012 at 6:32 am
Not being one to leave anything to chance, especially when I don't understand, I created a test harness on original input data expanding it to 7000 rows. Try it...
April 24, 2012 at 12:57 am
Ah wait! The culprit was the sort caused by using the PARTITION, which I missed on initial scrutiny of the query plan. Apparently it is much less efficient...
April 24, 2012 at 12:19 am
ColdCoffee - When first I looked at your query, my instincts told me there has to be an easier way.
So I came up with this:
DECLARE @sampledata TABLE (OrderNumber INT,OrderDetail INT,ItemCategory...
April 24, 2012 at 12:11 am
Like I said, self joins aren't particularly efficient. This solution produces a lower query plan cost so is likely to run faster than the self join or the first...
April 23, 2012 at 8:40 pm
This solution is a little more general in that it can remove any first word if it repeats within the string, instead of the one word (@word) set up in...
April 23, 2012 at 8:16 pm
I wouldn't say calculating the 'of x' part of the ranking is messy at all. Notice how I removed the rank column from your sample table. You can...
April 23, 2012 at 8:01 pm
I am in 100% agreement with Sean that a CURSOR is not required in this case and add that I'm 100% certain that converting to a single SQL INSERT will...
April 23, 2012 at 7:38 pm
Can't mess with your original query without lots of DDL, but I can show you how to take it from where you are now to where you want to be...
April 23, 2012 at 7:21 pm
Viewing 15 posts - 3,721 through 3,735 (of 3,956 total)