Forum Replies Created

Viewing 15 posts - 4,096 through 4,110 (of 7,187 total)

  • RE: Sum and Count

    To generalise, if you have n tables Table1, Table2, ... , Tablen where for each value of k Tablek has k rows populated with values 1,2,...,k:

    The COUNT is n!

    ...

  • RE: Sum and Count

    Are the exclamation marks in the explanation an expression of surprise, or are they supposed to represent factorials?

    John

  • RE: so many indexes indexes

    Client? Why is the client interested in indexes? All he needs is a database that performs according to his expectations (or according to SLAs). How you, as...

  • RE: Backup overwrite

    You should find all the information you need in the restorehistory table in msdb.

    John

  • RE: How to write these values down a column

    Dominic

    Here's another way of doing it. It avoids the correlated subquery in David's solution and so it may perform better. You'll want to test.

    John

    -- Data

    WITH MyCTE(ClaimKey ,ARevDate ,ARowNum,CauseCode)...

  • RE: Shrink log file

    A full backup will not do anything with the log files.

    I know. The full backup is in case shrinking the logs causes any problem that you might want to...

  • RE: Shrink log file

    It's OK to shrink files if the reason they've grown isn't likely to be repeated. This is indeed the case in your situation - somebody set the database to...

  • RE: Show Results When more than just my result shows up.

    This works for your sample data.

    -- Union both tables together

    WITH AllItems (ItemCode, FrgnName, UpdateDate) AS (

    SELECT ItemCode, FrgnName, UpdateDate

    FROM AITM

    UNION ALL

    SELECT ItemCode, FrgnName, UpdateDate

    FROM OITM

    )

    -- Number the rows for each...

  • RE: Update statement really slow but only on the first execution

    I'd wager that the trigger is your problem here. You've got functions within functions in it. You ought to try rewriting those functions as a very minimum. ...

  • RE: How to find values in a comma delimeted string with len>3

    Here's one way of doing it. It may not be the most efficient way, so you'll want to test for performance if you're going to use it in production.

    SELECT...

  • RE: Update statement really slow but only on the first execution

    Perhaps you're getting a page split? This can happen if you update a column with a variable length data type. How many indexes are there on your table?

    John

  • RE: Substract End Dates

    Kiran

    You need to add a computed column to the table. Use the DATEDIFF function to set its value.

    Incidentally, why are you storing date values as int in your table?

    John

  • RE: two jobs runnig at a time

    You can certainly run two jobs at the same time. Whether or not they have any impact on each other depends on what they do.

    John

  • RE: Index capacity calculation

    Add up the width of each column in the index, then add the width of the clustering key, and multiply the whole lot by the number of rows in the...

  • RE: Capturing Blocking info

    Steven

    You're just doing the SELECT but not doing anything with the results. I think you can set up your job to divert the output to a text file or...

Viewing 15 posts - 4,096 through 4,110 (of 7,187 total)