Viewing 15 posts - 1,156 through 1,170 (of 2,171 total)
Free plan cache with
DBCC FREEPROCCACHE
DBCC DROPCLEANBUFFERS
December 11, 2007 at 5:44 am
Well then. Just do a JOIN.
INSERT Target (PkCol, a, b, c, x, y, z)
SELECT t1.PkCol, t1.a, t1.b, t1.c, t2.x, t2.y, t2.z
FROM Source1 AS t1
INNER JOIN Source2 AS t2 ON t2.PkCol...
December 11, 2007 at 5:11 am
Yes.
But how will you match the two tables?
If you want a1, b1, c1, x1, y1 and z1 how can you ensure that so that you do not end up with
a1,...
December 11, 2007 at 4:54 am
Thank you for your kind response.
December 11, 2007 at 3:03 am
Regarding moving average, here is an interesting discussion
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=93911
It involves a kind of triangular join with a finite number of records to join.
December 10, 2007 at 1:03 pm
Also look at this
December 10, 2007 at 4:55 am
select Discount from table where DiscountMatrix = 'CIDG' and CustomerGroup = 'BENCH'
select Discount from table where DiscountMatrix = 'BIDG' and DiscountGroup = 'BA'
where not exists (select * from table as...
December 5, 2007 at 5:58 am
select Discount from table where DiscountMatrix = 'CIDG' and CustomerGroup = 'BENCH'
union
select Discount from table where DiscountMatrix = 'BIDG' and DiscountGroup = 'BA'
December 5, 2007 at 5:57 am
DECLARE@Employee TABLE (ID INT, Date SMALLDATETIME, ShiftID TINYINT)
INSERT@Employee
SELECT12345, '01/01/2007', 1 UNION ALL
SELECT88877, '01/01/2007', 2 UNION ALL
SELECT99994, '01/03/2007', 2 UNION ALL
SELECT12345, '02/01/2007', 1 UNION ALL
SELECT12345, '03/01/2007', 1
DECLARE@WantedDate SMALLDATETIME, -- Use as...
December 5, 2007 at 3:02 am
Nah, SAN is overrated 😉
Just put in 128 gig RAM and make a ramdrive for 32 gig.
Then put tempdb on ramdrive and hopefully rest of the database could reside in...
November 14, 2007 at 8:03 pm
Great!
I think you should keep integer as datatype, and format the result at the frontend
case
when count(*) < 2 then CAST(NULL AS INT)
else DATEDIFF(DAY, MIN(OrderDate), MAX(OrderDate)) / (COUNT(*) -...
November 13, 2007 at 2:16 pm
DECLARE@SampleTABLE (Customer VARCHAR(5), OrderDate DATE)
INSERT@Sample
SELECT'Jones', '1/5/2007' UNION ALL
SELECT'Jones', '2/8/2007' UNION ALL
SELECT'Smith', '8/31/2006' UNION ALL
SELECT'Smith', '5/2/2007' UNION ALL
SELECT'Jones', '10/21/2007' UNION ALL
SELECT'Smith', '9/4/2007'
SELECTCustomer,
DATEDIFF(DAY, MIN(OrderDate), MAX(OrderDate)) / (COUNT(*) - 1) AS AvgDays
FROM@Sample
GROUP...
November 13, 2007 at 12:46 pm
I found that CROSS APPLY was almost identical to CROSS JOIN.
In my early tests, I had a CLUSTERED INDEX on MyNumbers (tally) table.
SELECTt1.ndex,
t1.twodigit,
t1.tenPower,
1
FROMdbo.testData as t1 WITH (INDEX (ixu_testdata_ndex_incl_tenpower_twodigit))
CROSS APPLY(
SELECTt2.N
FROMMyNumbers AS...
November 13, 2007 at 7:37 am
Viewing 15 posts - 1,156 through 1,170 (of 2,171 total)