Forum Replies Created

Viewing 14 posts - 61 through 74 (of 74 total)

  • RE: Question of the Day for 23 Jul 2004

    I guess the reason for not using select @@version (which I agree is far easier to type ) is that @@version requires further interpretation...

  • RE: How can I do this in SQL?

    I'm not sure I can manage all that in a single query, however a stored procedure would be straightforward enough: use statements like select top 1 where <, select top...

  • RE: giving identity value based on data output

    Try this

    update tablename T
    set job_index = (select count(job_id) from tablename T2 where T.location=T2.location and T.job_id<T2.job_id) + 1

    Here we are saying 'for all rows, set job_index to (the number of rows with...

  • RE: Is all code really code? One question from an interview

    I would love to use an integrated T-SQL debugged from within the Visual Studio IDE. Unfortunately, at the last THREE sites where we have tried to get it to work,...

  • RE: Top 5 rows for a group

    This should work...

    select order_id, account_id, order_date, order_status
    from ordertable O
    where
    -- the latest order for a given account
    order_date = (select max(order_date) from ordertable O2 where O.account_id=O2.account_id)
    or
    -- the not-quite-latest for a given account,...
  • RE: How to expand @variables in SQL Statement

    I have to give a hearty 'me too' to what Julian Kuiters said. Don't use dynamic SQL unless you absolutely have to! - and even if you think you have to,...

  • RE: query question

    OK so you want two kinds of row displayed in the query - type A: those that are the start of a 2+ week run of not-in-office, and type B: those...

  • RE: Looping without a cursor

    Here's one example. Suppose you have Table1 with an id field ID and a flag field AwaitingProcessing. You need to process each row that has AwaitingProcessing equal to 1; for whatever reason,...

  • RE: Parameter driven where & order by

    I would say what you say you have at the moment (which I assume is along the lines of

    if var=A then

    select fields from table where condition1

    elseif var=B then

    select fields from...

  • RE: What is N ???

    "to do with unicode" is correct. Just as the delimeter characters for a char, varchar, or text type literal are ' and ' (or " and "), the delimeter characters...

  • RE: many individual inserts slow - need suggestions

    - Create a temporary table with the same columns as the target table, but with no indexes (to speed inserts)

    - Do the one-by-one inserts into the temporary table

    - When those...

  • RE: SPROC permissions error if using EXEC("select......

    If the SP runs arbitrary dynamic SQL, then the user must have the ability to run arbitrary SQL. However, I suspect there is going to be some pattern to the...

  • RE: Sort

    Depending on the client that is receiving the queery results (VB, Crystal Reports, whatever), there will be different ways for handling the aliased computed (' ... AS ...') column.

    Your client...

  • RE: "Watch this topic"

    To get to a list of your watched topics:

    Float over the 'My Account' element in the toolbar while you are viewing a forum page; the second item on the drop...

Viewing 14 posts - 61 through 74 (of 74 total)