Forum Replies Created

Viewing 15 posts - 16 through 30 (of 582 total)

  • RE: Function to cast an integer to a varchar where 1 = A, 26 = Z, ...

    Surely this is base 27?

    1 becomes 0A, 2 becomes 0B, 26 becomes 0Z, 27 becomes A0, 28 becomes AA,... seems pretty clear to me. OK, then there's a slight...

    Tim Wilkinson

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

  • RE: Need script to UPDATE 1000 Rows then COMMIT, Iteratively

    Just to be a bit pedantic, the + 1 here:
    UPDATE MyTable SET MyColumn  = MyCounter + 1
    means you will start your numbering at 2.

    A couple of...

    Tim Wilkinson

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

  • RE: Insert into view with trigger on LinkedServer not working

    I've come across this sort of problem before, but it was a longish time ago so I can't guarantee that my account is exactly right, but from memory:

    1. SQL determines...

    Tim Wilkinson

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

  • RE: Duplicating rows in a table by count

    select * from table t
    join master.dbo.spt_values n
    on n.number < t.count
    where n.type = 'P'

    This will work for counts up to 2047.

    Tim Wilkinson

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

  • RE: design question for "master" Item data structure

    Bet on what? I see you got there first: I didn't see your entry until I posted mine.

    But 4 tables, not 1?

    Tim Wilkinson

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

  • RE: design question for "master" Item data structure

    select a.Name ObjectName, a.AppID ObjectID, a.IsSecurityRisk

    from

    Applications a

    union

    Tim Wilkinson

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

  • RE: execute stored procedure in a cursor for statement

    If you want to define a cursor on the output of a sp, you need to use INSERT...EXEC into a (temp) table, then define your cursor on that table.

    Tim Wilkinson

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

  • RE: DISTINCT

    The list of columns which the DISTINCT keyword will operate on is already provided in the SELECT list. Yu just need to add the DISTINCT keyword. If you want to...

    Tim Wilkinson

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

  • RE: Same function called twice with different params returning same value

    Your problem is probably that the charindex() and isnumeric() checks are not working in the way you expect. Can you post the code?

    Tim Wilkinson

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

  • RE: Conditionally Incrementing a Counter in a While Loop

    I can't work out what you are actually trying to achieve. What is the logic behind all these cycles and random numbers? It seems overcomplicated. Is the approach dictated by logical...

    Tim Wilkinson

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

  • RE: Alternate to CHECKSUM ??

    So are they all int columns? Is the domain the full range of int values?

    Tim Wilkinson

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

  • RE: Alternate to CHECKSUM ??

    You could try a checksum with an explicit column list, and change the order of the columns. This can help to reduce duplicate values. what are the columns you are...

    Tim Wilkinson

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

  • RE: creating database with out copying user defined objects in model

    If you don't want the user-defined objects to be in every database you create, you should remove them from the model database. Unless you do that, you will have to...

    Tim Wilkinson

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

  • RE: Longitude Latitude Radius

    This also presupposes that you convert your lat/longs into a suitably flattened grid projection as on a map with square grid. The surface distance of one minute of either longitude...

    Tim Wilkinson

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

  • RE: All Combinations

    Cross join is certainly the way to achieve the described result. But you mention every possible combination of all three categories - do you want to ignore the association between group...

    Tim Wilkinson

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

Viewing 15 posts - 16 through 30 (of 582 total)