Viewing 15 posts - 10,201 through 10,215 (of 15,381 total)
I think this should do what you are looking for but it is untested because I don't have ddl to work with.
create trigger TRG_CONTRIBUINTES_VERIFCA_RF_E_NIF on contribuintes
for update
as begin
update contribuintes
set nif...
October 30, 2012 at 9:51 am
river1 (10/30/2012)
update
contribuintes
set
nif = c.nif
from
contribuintes c
join
inserted i
on
i.nif_antigo = c.nif_antigo
where
i.numeroposto = 'Central'
Has a problem.
I want...
October 30, 2012 at 8:59 am
matt.newman (10/30/2012)
Sorry, trying to do a few things but overalldeclare @insertednif and @deletednif
select via select
if insertednif <> deletednif
begin
rollback
return
end
no no no. You do not want to use variables like this in...
October 30, 2012 at 8:57 am
river1 (10/30/2012)
like this:update
contribuintes
set
nif = c.nif
from
contribuintes c
join
deleted d
on
d.nif_antigo = c.nif_antigo
where
c.numeroposto = 'Central'
Think you need to set...
October 30, 2012 at 8:55 am
river1 (10/30/2012)
I only want that the trigger acts if the column numeroposto new value is 'Central'. If it's not,...
October 30, 2012 at 8:38 am
Incredibly sparse on details but I think this is close...
update contribuintes
set nif = c.nif
from contribuintes c
join inserted i on i.PrimaryKey = c.PrimaryKey
where i.numeroposto = 'Central'
update contribuintes
set cod_rep_fiscal = c.cod_rep_fiscal
from...
October 30, 2012 at 8:23 am
Sean Lange (10/30/2012)
You have certainly been around here long enough to know that we need ddl and some sample data along with desired results.
October 30, 2012 at 8:10 am
From what you described I would imagine you have horrible performance. What does your splitter code look like? Cursors are notoriously horrendous performance hogs and I doubt you actually need...
October 30, 2012 at 8:06 am
I am sure that what you posted is very clear for you. Unfortunately we don't know your project or data and we can't see you screen. If you can post...
October 30, 2012 at 8:02 am
gsd1 (10/30/2012)
As Sean Lange suggested, I tried with temp table (instead of temp variable).
I faced these problems.
1. I have to build the sql statement. So...
October 30, 2012 at 7:59 am
You have some very serious logic flaws in here. You keep trying to reference your table like a variable and it just doesn't work like that.
if (contribuintes.NUMEROPOSTO) ='CENTRAL'
if contribuintes.cod_rep_fiscal not...
October 30, 2012 at 7:47 am
Luis Cazares (10/29/2012)
AFAIK, there's no way to convert a timestamp to datetime because there are no datetime values in the timestamp.To avoid confusions, Microsoft has implemented the synonym rowversion.
Reference:
http://msdn.microsoft.com/en-us/library/ms182776(v=sql.90).aspx
Luis is...
October 29, 2012 at 2:50 pm
eugene.pipko (10/29/2012)
I guess what I am trying to do is to let the other...
October 29, 2012 at 2:42 pm
there are plenty of products around which would perfectly qualify for such codes as CRAP, SH*T and other...
+100
October 29, 2012 at 2:36 pm
sunny.tjk (10/29/2012)
Would there be any slowness in performance if a query involves dateadd(day,datediff(day,1,GETDATE()),0) in the WHERE clause?
There of course is some impact to performance but it is actually pretty minimal...
October 29, 2012 at 1:33 pm
Viewing 15 posts - 10,201 through 10,215 (of 15,381 total)