Viewing 15 posts - 46,501 through 46,515 (of 59,095 total)
It'll work if you put the SELECT LIST into the same order as the COLUMN LIST in the table definition. It would be better if the INSERT had a...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 20, 2008 at 4:41 pm
This type of denormalization is not normally a good thing to do in a database... why do you need to do this? What is the purpose?
--Jeff Moden
Change is inevitable... Change for the better is not.
December 20, 2008 at 4:26 pm
Now, it's just missing the FROM clause.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 20, 2008 at 6:23 am
From a much less technical stance...
The only thing I haven't been able to do faster in T-SQL, so far, is RegExReplace and I still came pretty close.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 20, 2008 at 6:19 am
rog pike (12/19/2008)
Jeff Moden (12/19/2008)
Heh... Just what you were hoping for, huh, Steve?
That strikes me as an interesting question. I'm not sure if it's the case that right now I...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 20, 2008 at 5:28 am
Lynn Pettis (12/19/2008)
create table #MyTest (
CompanyName varchar(50),
CompanyID varchar(10),
RegionID char(2)
);
insert into #MyTest
select 'ANDERSON DAIRY PRODUCTS ...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2008 at 4:17 pm
Jason White (12/18/2008)
Note: the solution is actually easier in SQL 2K+ than with SQL 7 or 2000.
How do you figure that?
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2008 at 4:12 pm
Heh... Just what you were hoping for, huh, Steve?
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2008 at 4:06 pm
Let's try that again...
--===== Create artificial rows where all inclusive dates are in place for each Person_ID
SELECT ISNULL(ROW_NUMBER() OVER (ORDER BY aid.Person_ID, aid.Event_Date),0) AS RowNum,
...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2008 at 3:57 pm
Hang on a minute... I'll fix the smiley faces...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2008 at 3:55 pm
I think this will do it very quickly using the ol' "Divide and Conquer" methods. Side benefit it that it doesn't affect the original table... it makes a brand...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2008 at 3:54 pm
If there were a table creation statement and those were insert statements, I know someone that might show you how...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 19, 2008 at 11:43 am
Heh... thanks for the feedback... didn't mean for it to be so stark. :hehe: Any questions on how that works?
--Jeff Moden
Change is inevitable... Change for the better is not.
December 18, 2008 at 7:37 pm
psmg01 (12/18/2008)
I tried your tally table and splitting the string as rows in a table output.
But how to make them as columns? or use crosstab to make it as...
--Jeff Moden
Change is inevitable... Change for the better is not.
December 18, 2008 at 7:24 pm
Chad Crawford (12/18/2008)
--Jeff Moden
Change is inevitable... Change for the better is not.
December 18, 2008 at 7:06 pm
Viewing 15 posts - 46,501 through 46,515 (of 59,095 total)