Viewing 15 posts - 136 through 150 (of 321 total)
CREATE TRIGGER INS_tblmembers
ON tblmembers
FOR INSERT
AS
INSERT INTO TX_tblmembers
Select ID, fname, lname, address,newid(),'i',getdate(),0 from inserted
CREATE TRIGGER DEL_tblmembers
ON tblmembers
FOR DELETE
AS
INSERT INTO TX_tblmembers
Select ID, fname, lname, address,newid(),'d',getdate(),0 from...
August 29, 2005 at 8:25 am
You can eliminate your cursor
SET @SQLStr = 'SELECT rpt.pagetype, rpt.PageFontColor, rpt.PageTypeAbbrev, count(rh.Project_requestheader_pkey) as TotalPagetype, p.projects_pkey'
SELECT @SQLStr = @SQLStr + ',SUM(CASE WHEN pl.ProjLegend_abbrev= ''' + PageTypeAbbrev + '''
THEN 1...
August 29, 2005 at 7:58 am
From your sample data you are missing the acdkennung table.
Also you have too many rows. To provide a good sample just give an example with a few rows ... 5-...
August 29, 2005 at 7:19 am
This can be replaced
--8. look for time changes on the schedule
CREATE TABLE #tcs
(
personalnummer int default null,
agentname char (30)default null,
eintrittsdatum char(20)default null,
datum char(20)default null,
code char(10)default null,
start_moment datetime default null,
stop_moment datetime default...
August 26, 2005 at 1:28 pm
SELECT distinct t1.personalnummer,t1.agentname,t1.eintrittsdatum,
t1.datum,t1.code,t1.start_moment,t2.stop_moment,t1.groupid
FROM svtcs T1 JOIN svtcs T2 ON (t1.personalnummer=t2.personalnummer)
WHERE t1.stop_moment =
(SELECT MAX(t3.stop_moment)
FROM svtcs T3
WHERE (t3.personalnummer=t1.personalnummer)
AND t3.stop_moment =t2.start_moment)
if it is K than you can ELIMINATE the...
August 26, 2005 at 10:13 am
INSERT INTO #tcs
SELECT distinct t1.personalnummer,t1.agentname,t1.eintrittsdatum,
t1.datum,t1.code,t1.start_moment,t2.stop_moment,t1.groupid
FROM svtcs T1 JOIN svtcs T2 ON (t1.personalnummer=t2.personalnummer)
WHERE t1.stop_moment =
(SELECT MAX(t3.stop_moment)
FROM svtcs T3
WHERE (t3.personalnummer=t1.personalnummer)
AND t3.stop_moment =t2.start_moment)
this insert is weired
Do you...
August 26, 2005 at 8:34 am
First is mine ...sec is just a translation of what Remi suggested : ) ( which is like yours)
the Exec plan for the first is cheaper
August 25, 2005 at 3:08 pm
declare @t table([name] varchar(3),[date] datetime)
insert into @t
select 'aaa', '8/19/2005' union all
select 'bbb', '8/19/2005' union all
select 'ccc', '8/20/2005' union all
select 'aaa', '7/29/2005' union all
select 'bbb', '8/24/2005' union...
August 25, 2005 at 3:04 pm
comma means a join between result of
(fooTable foo
inner join barTable bar on foo.id = bar.ForeignKey)
and #tmpDates
August 23, 2005 at 11:14 am
where
startDate IS NOT NULL and
endDate IS NOT NULL and
datediff(yy, startDate, endDate) > @numYears
August 23, 2005 at 10:54 am
select top 1 *
from TestRequestState
WHERE StateId = '11'
ORDER BY TestRequestNO DESC
August 23, 2005 at 9:55 am
Just add NMB of Variable =as many FIELDS you have and do a
select var1=field1, var2=field2 ...
just like in this example
declare @Tmp table (a int,b int identity(1,1))
insert into
August 23, 2005 at 8:40 am
Just put all fields that you have in 1 line and read Normalization to create your tables
August 23, 2005 at 8:23 am
This query selects those groups (folio_no, product_cd) that have ONLY 1 value for rm_cd in GROUP
count(distinct rm_cd). min(rm_cd) =MIN is used ONLY because they don't GROUP by rm_cd so they...
August 23, 2005 at 8:10 am
Also try to change the IDLocation data type to be an INT (wich should cover your location) but will MUCH faster than have UniqueIdentifier
IDLocation='{2D93FD6E-64F7-4A0A-A7F9-0B806D8907ED}'
August 23, 2005 at 7:58 am
Viewing 15 posts - 136 through 150 (of 321 total)