Forum Replies Created

Viewing 15 posts - 136 through 150 (of 582 total)

  • RE: Using GROUP BY in a SELECT statement with Multi-CASE

    1. the so-called read-only access may not be enforced only by SQL server permissions. There are things which a DBA is trusted not to do.

    2. DENY CREATE TABLE or GRANT...

    Tim Wilkinson

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

  • RE: Brutal Query

    What do you mean by 'the second table'? Where has this second table come from, and how does it get itself involved in my SQL statement?

    Tim Wilkinson

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

  • RE: TimeStamp from string ?

    create

    function dbo.fn_char16tobin8 (@hexstr as char(16))

    returns

    binary(8)

    Tim Wilkinson

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

  • RE: Replace large table with 2 and view without breaking legacy app.

    Your default will still work even if the column is nullable. But if you can't allow the column to contain nulls under any circumstances (e.g. mistake in app code), and using...

    Tim Wilkinson

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

  • RE: Interview question

    Yes, and therefore not to be relied on.

    Tim Wilkinson

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

  • RE: An oppertunity to get a new SQL Comparison tool for free

    Get out of my face

    Tim Wilkinson

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

  • RE: Using GROUP BY in a SELECT statement with Multi-CASE

    >SQL doesn't like the double paren at the end...
     
    that isn't the correct explanation of your error. SQL doesn't have a problem with double parentheses.

    Tim Wilkinson

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

  • RE: Concat question

    alter table Table_name add Age_range as  cast(Age_start as varchar(10)) + '_' + cast(Age_end as varchar(10))

     

    Tim Wilkinson

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

  • RE: Concat question

    You should use an indexed calculated column since that way the data is maintained automatically and can't be overwritten:

    alter table Table_name drop column Age_range
    go
    alter table...

    Tim Wilkinson

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

  • RE: date and time calculations

    Is the datetime an end time, or a duration (i.e. 0 duration = 1 jan 1900)? In the former case, you could use the code below (though you will have...

    Tim Wilkinson

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

  • RE: Brutal Query

    no probs

    Tim Wilkinson

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

  • RE: Brutal Query

    Thanks

    Tim Wilkinson

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

  • RE: Brutal Query

    Peter, can you come up with an example in which my solution doesn't give the right result? (Clue: the answer is no.)

    Tim Wilkinson

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

  • RE: Using GROUP BY in a SELECT statement with Multi-CASE

    A compromise between

    1. a lookup table with app,user,dtype (which would involve some odd joins anyway with the <> and the ELSE) and

    2. just putting a slab of code...

    Tim Wilkinson

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

  • RE: Brutal Query

    Ta muchly

    Tim Wilkinson

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

  • Viewing 15 posts - 136 through 150 (of 582 total)