Forum Replies Created

Viewing 7 posts - 16 through 22 (of 22 total)

  • RE: Date Calculations

    Never mind, I figured it out.

    select AVG(days)

    from

    (select datediff(dd, min(sc.transDate), max(sc.transDate)) as days

     from  detail sc

    inner join header sm on sm.ID = sc.ID where sm.status = 'CLOSED'

    group by sm.ID) tblTemp

     

    Thanks

  • RE: Stored Procedure timing

    Thank you all for great improvements, it's been a great learning experience.

     

    Thanks

    Allen

  • RE: Stored Procedure timing

    Here most of the sp.  I left a little bit out, I'm creating two different cust no's, one has to start with a M, they both have different starting places...

  • RE: Insert Trigger questions

    Thanks PW, I've rewritten it to be set based, plus now its much simplier. 

    CREATE TRIGGER UPD_CUST_PART ON dbo.data

    FOR INSERT

    AS

    BEGIN

    UPDATE data 

     SET custpart =

    left(RIGHT(LEFT(cast(s.textfld as varchar(500)),(CHARINDEX(CHAR(13),cast(s.textfld as varchar(500)))-1)),((CHARINDEX(CHAR(13),CAST(s.textfld as varchar(500)))-1)-15)),25)

     ...

  • RE: Insert Trigger questions

    OK, I think I understand the updating part. 

    At this time they will be single transactions, but you never know about the future. How would you do a set based...

  • RE: Running reports on a linked server

    Thanks Martin.  That sounds good.

  • RE: Running reports on a linked server

    Thanks Jon.

    Would it also be possible, to create a distributed query on to the linked server and use that in a view on SQL 2005.  And then in turn use...

Viewing 7 posts - 16 through 22 (of 22 total)