Forum Replies Created

Viewing 15 posts - 91 through 105 (of 582 total)

  • RE: Aggregate on text field

    Something like this? I suspect you don't need aggregates. If you do, why MAX() of a long character field? This solution assumes (updateID,langID) is unique in updatedetails.

    select

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Data type conversions

    --Had a look at the functions from http://aspfaq.com/show.asp?id=2390 linked in the above post,
    --and made some minor alterations, using a fairly arbitrary set of conditions.
    --These versions should...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Table Variable Update error

    Using dynamic SQL doesn't generate a new spid (session). It generates a new batch. Temp tables have session scope so they are visible to the new batch. Table variables have batch...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Need a fresh set of Eyes and an opion from an expert!!!

    Your problem most probably arises from the presence of NULLs in your employees table:

    Q1:

    --original 'valid reps' query - correct results

    select

    i ValidReps_Original_Query...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Gar!!! Really odd syntax error

    To expand on the above comments, v9 supports nested comments. But v8 recognises */ and not /* inside a comment block. Once a /* is encountered, further /* s are ignored (treated as comment text)...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Can''''t insert certain charcters into SQL table

    The answer is the difference between the single-quote character:

    '

    as a part of a string value, as for example ,

    lastname
    --------
    O'Toole
     
    (which is part...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: How to get the Cursor Location in a while loop ?

    Yes, no dangling transactions please. Remiss not to mention it. And yes, once again, (all together now) must you use a cursor?

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Help Required with 2 Triggers

    I (embarassingly!) dropped the GROUP BY clause when pasting the code in. Still, at least it wouldn't parse at all, as is.

    group

    by b

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: @Local_Variable 8k Limit

    The reason given was:

    >The reason for relying on a "Set @Qry" then executing it, is because this is only a small part of a larger SP and there...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: saving @@error

    @@rowcount is another example. If you want to capture both @@rowcount and @@error, you have to get both at the same time, directly after the statement you are 'watching', otherwise the...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: Selecting only the max row

    --If you only want to return one row you can use:

    select

    top 1 *

    from

    ...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: SQL to return selected rows

    You may need to add some null handling in the having clause.

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: How to get the Cursor Location in a while loop ?

    The question is, how to pass this back to the client while the cursor is processing.

    To expand on the idea of processing batches, you can open the cursor first, then...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: How to get the Cursor Location in a while loop ?

    You could do the process in batches keeping track of how many batches of what size have been executed so far. If you have more than one connection to the DB, the process...

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

  • RE: TimeStamp from string ?

    Good decision. First rule of cost-benefit analysis: the past doesn't exist.

    Tim Wilkinson

    "If it doesn't work in practice, you're using the wrong theory"
    - Immanuel Kant

Viewing 15 posts - 91 through 105 (of 582 total)