Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)

  • RE: Update field in INSERTED inside trigger

    Why don't you try to add an identity column?

    For best performance make it a clustered primary key.

  • RE: Update with CASE statement

    I used your example in the code bellow and it seems to work fine. Few suggestions:

    - Write static SQL first to make it work (I had problems with...

  • RE: INSERT INTO in usde defined function

    You have 2 options (at least) here:

    1. Rewrite your function as SP so you can use INSERT INTO

    2. Rewrite function to return table (single row in this case) so you can...

  • RE: Query using view with outer join

    It should work (in this case) if you use OUTER JOIN in the view. (I assume that join expression t1.emp_num = t2.emp_name is a typo and should be t1.emp_num =...

  • RE: Preformance Tuning Advice

    - Wach out for the code used in sub-SPs

    IF @ReturnVal = NULL SET @ReturnVal = 0

    use IF @ReturnVal IS NULL SET @ReturnVal = 0    or     SET @ReturnVal = ISNULL(@ReturnVal, 0)

    Also,...

  • RE: Trying to SUM on an alias field

    Option 1

    Use derived table. Just enclose your main query in parenthesis and use it in a FROM clause of the GROUP BY query. You MUST specify alias for derived table.

    SELECT...

Viewing 6 posts - 1 through 6 (of 6 total)