Viewing 15 posts - 121 through 135 (of 322 total)
declare @t table
(Location int,
Item int,
SalesWeek int,
Qty int)
insert into @t
select 1,1,1,1 union all
select 1,1,2,6 union all
select 1,1,3,5 union all
select 1,1,4,2 union all
select 1,1,5,7 union all
select 2,1,1,4 union all
select 2,1,2,1 union...
Vasc
August 31, 2005 at 11:04 am
Is this a catch or a bad request ???
"PK is location, item, salesweek.
Tables contains records for many locations for many weeks for many items. I need to remove the Vasc
Kindest Regards,
August 31, 2005 at 9:56 am
http://support.microsoft.com/default.aspx?scid=kb;en-us;329332&Product=sql
Vasc
August 31, 2005 at 8:38 am
delete svtcs
where code in ('Pause','Pause1','Pause2','Shift','Lunch')
delete svtcs
where code in ('CS','OE','Home') and Groupid = 20
--can be
delete svtcs
where code in ('Pause','Pause1','Pause2','Shift','Lunch')
or (code in ('CS','OE','Home') and Groupid = 20)
--7.identify the Personalnumber
update svavaya
set personalnummer =...
Vasc
August 31, 2005 at 7:51 am
--the second part
update svlisteks
set sollstart=a.sollstart,sollstop=a.sollstop, DEP=a.DEP
from
(
select sv.* from
svliste sv left outer join svlisteks svks
on svks.agent = sv.agent --same agent
and svks.datum=sv.datum --same datum
and ISNULL(sv.sollstart,'')=ISNULL(svks.sollstart,'')
and ISNULL(sv.sollstop,'')=ISNULL(svks.sollstop,'')
and ISNULL(sv.DEP,'')=ISNULL(svks.DEP,'')
where svks.agent IS...
Vasc
August 30, 2005 at 2:59 pm
insert into svlisteks
select sv.* from
svliste sv left outer join svlisteks svks on
svks.agent=sv.agent
and
sv.datum=svks.Datum -- a record in svliste has a diff Datum than ANY in svlisteks for a certain agent
where
svks.agent...
Vasc
August 30, 2005 at 12:55 pm
--if you want to ADD the changes
insert into svlisteks
select sv.* from
svliste sv left outer join svlisteks svks
on svks.agent = sv.agent --same agent
and svks.datum=sv.datum and --same datum
sv.sollstart=svks.sollstart and sv.sollstop=svks.sollstop and sv.DEP=svks.DEP where sv.agent IS...
Vasc
August 30, 2005 at 10:11 am
--first part INSERT missing records in svlisteks
insert into svlisteks
select sv.* from
svliste sv left outer join svlisteks svks on
svks.agent=sv.agent
where
sv.datum<>svks.Datum -- a record in svliste has a diff Datum than...
Vasc
August 30, 2005 at 10:04 am
Still didn't respond to what means a change!
For example :
- INSERT when into svlisteks from svliste when the agent's record is NOT in svlisteks but EXISTS in svliste
-INSERT into svlisteks...
Vasc
August 30, 2005 at 9:05 am
"I only want the changes update."
What do you consider change?
ONLY the new records in svliste?
Vasc
August 30, 2005 at 8:31 am
SELECT
PriceDate,
PortName,
'Amount1' = SUM(CASE WHEN TransCatCode='005'THEN BaseSettleAmt ELSE 0 END),
'Amount2' = SUM(CASE WHEN TransCatCode='010'THEN BaseSettleAmt ELSE 0 END),
'Par'=SUM(CASE WHEN TransCatCode='005'THEN BaseSettleAmt WHEN TransCatCode='010' THEN -BaseSettleAmt ELSE 0 END)/1000
FROM Table1
WHERE SUBSTRING(PortName, 1,...
Vasc
August 30, 2005 at 8:24 am
Can't figure out what you need : (( The second part retrieves the first record that you posted...
select sv.* from
svliste sv left outer join svlisteks svks on
svks.agent=sv.agent
where svks.agent is...
Vasc
August 30, 2005 at 7:54 am
Thomas because your only problem is that update just put here the DDL for svlisteks, svliste and some sample (5-10 rows) date in each one and the result that you...
Vasc
August 29, 2005 at 9:28 am
CREATE TRIGGER IDU_tblmembers
ON tblmembers
FOR INSERT, UPDATE, DELETE
AS
INSERT INTO TX_tblmembers
Select ID, fname, lname, address,newid(),'d',getdate(),0 from deleted
INSERT INTO TX_tblmembers
Select ID, fname, lname, address,newid(),'i',getdate(),0 from inserted
Vasc
August 29, 2005 at 8:45 am
None beside copy-paste : )
Vasc
August 29, 2005 at 8:32 am
Viewing 15 posts - 121 through 135 (of 322 total)