Viewing 15 posts - 151 through 165 (of 268 total)
Assuming correct ordering of the rows !
And also not taking into account that the data is grouped on O_ID, which must be included in the join criteria.
/rockmoose
June 29, 2004 at 10:03 am
Ok, Identity columns are only necessary if you don't have a primary key or unique index.
If you have that there is no point in adding an identity column.
This got me...
June 29, 2004 at 9:56 am
Cheers Wayne,
select convert(bigint,0xFFFFFFFFFF)
-- 1099511627775
-- only a-z characters (26) char(10)
select power(convert(bigint,26),10)
-- 141167095653376
/rockmoose
June 29, 2004 at 9:14 am
Should be no duplicate data. The sample data was corrupt.
( 31175, '2003/11/25 13:08' ) is duplicate in sample.
CONSTRAINT [PK_FSA_ORDER_CHNG_HIST] PRIMARY KEY CLUSTERED
( [O_ID], [O_TMST] )
You do have this on...
June 29, 2004 at 8:32 am
Yeah, see this.
Try:
select
outd.O_ID,
outd.O_TMST,
isnull(
( select ind.To_Dept from dummy ind where ind.O_ID = outd.O_ID
and ind.O_TMST = ( select max(inind.O_TMST) from dummy inind
where inind.O_TMST < outd.O_TMST and inind.O_ID = outd.O_ID 
June 29, 2004 at 8:15 am
... you will find that you can store many rows in your 4 bytes Int. If you use a char, you will need a char(10) to hold the same...
June 29, 2004 at 7:56 am
A char(5) consumes 5 bytes, an int 4 bytes. A 32bit processor would be better at comparing 32 bit data than 40 bit data ?
If you have smaller data the data...
June 29, 2004 at 7:49 am
We process a lot of cubes, and sometimes the AS locks up objects, and what do we do ? well we restart the AS .
I...
June 29, 2004 at 7:21 am
Sometimes subselecting can do the trick:
select
outd.O_ID,
outd.O_TMST,
isnull(
( select ind.To_Dept from dummy ind where ind.O_ID = outd.O_ID
and ind.O_TMST = ( select max(inind.O_TMST) from dummy inind
where inind.O_TMST < outd.O_TMST ) ), outd.From_Dept ),
outd.To_Dept
from
dummy...
June 29, 2004 at 7:16 am
You might have dirty data. ( especially since You didn't expect duplicates )
What is the primary key of emp_table ?, and what are the Unique Indexes on emp_table ?.
Can an...
June 29, 2004 at 6:18 am
Hi,
A cube does not have "rows" as such. But the number of rows needed to be read from the database to populate the cube is usually equal to the number...
June 29, 2004 at 6:07 am
Hi,
This is with using newid() as randomizer:
declare @digits table(nr int)
insert @digits(nr) select 0 union select 2 union select 4 union select 6 union select 8
insert @digits(nr) select nr+1 from @digits
select...
June 29, 2004 at 5:46 am
Actually the 8000 bytes length restiction on character datatypes is a restriction on the datatype and not on the representation of the data itself, ( 1 byte per character for...
June 24, 2004 at 12:46 pm
Hi,
When using sp_executesql it is more likely that SQL Server will be able to reuse the execution plan of the sql batch (BOL). This I think is only true when there are...
June 24, 2004 at 11:47 am
DECLARE @sqlprt1 VARCHAR(8000),@sqlprt2 VARCHAR(8000)
SET @sqlprt1 = 'SELECT * FROM /*....and long and long...*/'
SET @sqlprt2 = ' INFORMATION_SCHEMA.COLUMNS /*...and long and long...*/'
EXECUTE(@sqlprt1+@sqlprt2)
/rockmoose
June 23, 2004 at 3:34 pm
Viewing 15 posts - 151 through 165 (of 268 total)