Forum Replies Created

Viewing 15 posts - 181 through 195 (of 582 total)

  • RE: Divide by 2.1 Billion

    To expand on previous posts: Numerics don't have a format (until they are turned into strings, i.e. not numeric), so in that sense your request for division in scentific notation is misconceived. However, float...

    Tim Wilkinson

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

  • RE: Stored Procedures and Arrays

    Yes, there isn't really any more advice we can give unless you are more specific about your requirements, e.g., by posting the ASP code, or whatever SQL code you have come...

    Tim Wilkinson

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

  • RE: select date closest to today

    Implicit conversion from data type datetime to float is not allowed. Use the CONVERT function to run this query.

    I would use something like decimal(20,10):

    Tim Wilkinson

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

  • RE: Length of a string

    Yes, sorry, not clear. I was referring to the maximum capacity of 8000, as mentioned in the post above.

    The point being that insofar as you need to avoid overflow,...

    Tim Wilkinson

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

  • RE: Stored Procedures and Arrays

    Yes, SQL server supports a WHILE loop. But don't forget that you are translating from a primarily procedural laguage to a primarily relational language. So some of the things you...

    Tim Wilkinson

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

  • RE: select date closest to today

    select

    top 1 Hid, HDate

    from

    TheTable

    order

    Tim Wilkinson

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

  • RE: Strange SELECT behaviors

    You can get alphabetic and numeric order to coincide for strings containing positive integer literals by left-padding your strings with zeros. Better, use an indexed calculated column CASTing the values...

    Tim Wilkinson

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

  • RE: How to get the Last record?

    Unless you store a datetime when the record is inserted, I'm afraid it looks as though the information is not represented in your data.

    Tim Wilkinson

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

  • RE: Stored Procedures and Arrays

    SQL only has atomic values and relations/recordsets (tables, views etc.). Use a table variable with two columns: an identity(0,1) column to order the values (acts like the accessor subscript in...

    Tim Wilkinson

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

  • RE: Very Poor Performance - Identical Databases Yield Different Performance

    Impossible to say what's happening without seeing the differences between the two plans in more detail.

    Tim Wilkinson

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

  • RE: Execute Oracle Stored Procedure in SQL Procedure

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_qd_12_9ooj.asp

    - from BOL v8.

    It may not be relevant, but interestingly in BOL v9 the following is inserted just before the final paragraph:

    OPENROWSET and OPENQUERY support pass-through queries in...

    Tim Wilkinson

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

  • RE: In Cascade Delete how to get values from master for "after delete trigger" on child

    No sensible or reliable way of doing that. Once any triggers on the parent table have run, SQL won't let you intervene until any deletes have been cascaded. That's why they...

    Tim Wilkinson

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

  • RE: In Cascade Delete how to get values from master for "after delete trigger" on child

    You could use an 'instead of delete' trigger on the parent table to join to the child records and do whatever it is you want to do in the trigger...

    Tim Wilkinson

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

  • RE: Length of a string

    And divide that by 2 for unicode strings!

    Tim Wilkinson

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

  • RE: Alter all FK constraints removing update cascade.

    For v9+, sys.key_constraints, sys.indexes, sys.idex_columns, sys.foreign_keys, sys.foreign_key_columns and object_name() should give a most of what you need.

    Tim Wilkinson

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

  • Viewing 15 posts - 181 through 195 (of 582 total)