Viewing 15 posts - 46 through 60 (of 291 total)
Nice! That works great. Now I don't have to think as hard
Since it is completely set based there is no need to...
August 29, 2007 at 9:21 am
the "If Exists" check is to only perform the "increment update" if the incomming value is zero. This would allow a manual insert of a non-zero value such as 1000 in...
August 29, 2007 at 8:55 am
Try this:
Create trigger tri_gsp_spedizione on gsp_spedizione for Insert as
begin
declare @LastVal int
if exists (select 1 from inserted where val_numspedizione = 0)
begin
select @LastVal = Coalesce(Max(g.val_numspedizione),0)
from gsp_spedizione g join inserted i...
August 29, 2007 at 8:27 am
I'm sure there is a more efficient way and someone will probably post it, but to get started I would create and "After Insert" trigger. The trigger can first determine...
August 29, 2007 at 7:31 am
I was in federal law enforcement for 15 years, and often felt my hands were tied when it came to catching criminals. It seemed that criminals had all the "rights" and...
August 29, 2007 at 6:39 am
Oh, sorry, didn't see the RETURN after your comments. Move the "END" statement below the "RETURN" statement.
James.
August 28, 2007 at 11:53 am
put a "Begin" after the "AS" cluase:
and remove the "Begin" statement above the first insert.
Don't forget to RETURN your table, which doesn't appear to be in the FUNCTION.
James.
August 28, 2007 at 11:51 am
if the result needs to look exactly like table 2 then simply select everything from table 2. No need for a join at all. Please post an "EXACT" list of...
August 28, 2007 at 8:51 am
Excellent! I like the eloquence of your join statement. I'm curious if it is also more efficient or do the functions take a toll? I've never put one together that...
August 28, 2007 at 7:56 am
It would have been more helpful if you had provided example data for both tables and the output you were looking for (ie. the result set). But based on my...
August 28, 2007 at 7:12 am
I have to agree with Steve on this one. It is the "convenience" I'm paying for. The convenience of having my documents compatible with 99% of the business users out...
August 28, 2007 at 6:50 am
The case statements are all fine and have nothing to do with NULLs not being pulled during the query. This will depend on the Join statement (if multiple tables) and...
August 22, 2007 at 1:39 pm
Don't reference the Identity column in the insert statement and the DB will automatically assign the next value available.
Create table t1 (col1 int identity not null, col2 int)
then...
August 22, 2007 at 1:22 pm
Actually according to the documentation leading and trailing spaces are supported, only non-printing white space is not supported:
August 22, 2007 at 10:37 am
I thought so at first also but if you read each answer carefully you see that of the two dealing with leading and trailing spaces, one specifically mentions "White Space" and...
August 22, 2007 at 6:23 am
Viewing 15 posts - 46 through 60 (of 291 total)