Forum Replies Created

Viewing 15 posts - 6,751 through 6,765 (of 7,425 total)

  • RE: creating SQL login with cursor

    I, too, don't have a problem with a cursor per se here; it could be done w/o one, but it's not a big deal for such a limited number of...

  • RE: Convert Non Clustered PKs to Clustered

    Btw, it's always frustrated me that SQL Server can't seem to read only the non-leaf pages of a clustered index. If SQL needs only key column(s), why does it...

  • RE: Convert Non Clustered PKs to Clustered

    Don't automatically assume the PK makes the best, or even a good, clustered index, in particular if the PK is an identity column.

    You need to review the existing index usage,...

  • RE: Date Comparisons

    GSquared (1/7/2013)


    paul.j.kemna (1/7/2013)


    Wow, that makes a lot of sense. Such a simple concept that i may have overlooked in some places.

    But in this case, we are assuming that I...

  • RE: Using Results from one column to calculate another column

    CELKO (1/4/2013)

    Think about what a confused mess this statement is in the SQL model.

    SELECT f(c2) AS c1, f(c1) AS c2 FROM Foobar;

    That is why such nonsense is illegal syntax.

    Your...

  • RE: Using Results from one column to calculate another column

    If all the columns are from a single table, you definitely should created a computed column that has the computation: that way, the definition is in only one place. ...

  • RE: Index usage and RID lookup.

    🙂

    GilaMonster (1/7/2013)

    What is the basis for you claim that if only 1% of rows in the table match that SQL will almost certainly do a table scan? If the...

  • RE: Date Comparisons

    GSquared (1/7/2013)


    ScottPletcher (1/7/2013)


    GSquared (1/7/2013)


    Assuming "correct results" means dates between the two variable values, including the end-date value, then yes.

    As mentioned, using <= @EndDate can give odd results.

    For example:

    DECLARE @T TABLE

    ...

  • RE: Date Comparisons

    GSquared (1/7/2013)


    Assuming "correct results" means dates between the two variable values, including the end-date value, then yes.

    As mentioned, using <= @EndDate can give odd results.

    For example:

    DECLARE @T TABLE

    ...

  • RE: Index usage and RID lookup.

    GilaMonster (1/7/2013)


    ScottPletcher (1/7/2013)


    If so, SQL will use that; if multiple indexes with all columns, SQL uses the one with the shortest row.

    The most selective one (the one that, based...

  • RE: Measure Transaction size

    I suggest a hybrid method.

    Do something like the first method except that you begin new transactions only at certain record counts, for example, every 2000 values processed:

    record #1; record #2001;...

  • RE: Index usage and RID lookup.

    With a clustered index on ( A, B, C ) and a

    WHERE A = 6 AND C = 7

    I would expect SQL to a clustered index seek.

    That is, it will...

  • RE: Date Comparisons

    paul.j.kemna (1/7/2013)


    The actual syntax would be :

    DECLARE @StartDate as date

    SET @StartDate = some calculated date

    DECLARE @EndDate as date

    SET @EndDate = another calculated date

    CONVERT([varchar](10), MyDatetimeColumn, 101) AS MyDate

    ...

    WHERE MyDate >=...

  • RE: Dynamic SQL - which would you use?

    CELKO (1/4/2013)


    We're giving "power employees" of the company access to the company's data to derive business benefit.

    The power employees I work with regard me as the "Data...

  • RE: Dynamic SQL - which would you use?

    CELKO (1/4/2013)


    What specifically should requester do then?

    As I said, read books on basic Software Engineering. Yourdon and Constantine's STRUCTURED DESIGN is still classic. Chapters 6 and 7...

Viewing 15 posts - 6,751 through 6,765 (of 7,425 total)