Forum Replies Created

Viewing 15 posts - 48,091 through 48,105 (of 49,552 total)

  • RE: T-sql code to retain a max of 15 history rows per server

    Assuming that HistoryID is the primary key....

    DELETE FROM HistoryTable

    WHERE HistoryID NOT IN

    (SELECT Top 15 HistoryID FROM HistoryTable

    ORDER BY UpdTimestamp DESC)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Known problems with bit-columns?

    Grant Fritchey (12/7/2007)


    The main reason I've received for not using bit fields is because they don't allow null values.

    They accept nulls just fine (unless defined not null). At least...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: ***When I try to delete all the records the database table an errorbox appers stating TIMEDOUT.***

    use Query analyser to run the delete.

    Deletes can run for a long time, and the query time is probably exceeding the timeout value for the application that you're using. Query...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: data type

    Note that that's for varchar(max) or nvarchar(max) The largest number that you can use to define a varchar is 8000 (as in varchar(8000)) and 4000 for nvarchar (nvarchar(4000))

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: What to do to improve a table?

    Ramesh (12/7/2007)


    Create a non-clustered index on columns server, customer and add audit_output as include column.

    audit_output is ntext, and as such can't be used as an include column.

    Even if changed...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: What to do to improve a table?

    As first suggestions... These may not be completely optimal, as I don't hav your queries, I don't know the data distribution and I can't see the exec plans

    Clustered index on...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Waht is these _WA objects in sysindexes

    They are column statistics created by SQL when it filters or joins on a column that doesn't have an index or existing stats.

    They're there to tell the optimiser aproximatly...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Hidden RBAR: Triangular Joins

    TheSQLGuru (12/6/2007)


    I must say that I am very happy that people can do things like the triangular join - and sad that Jeff may make less people do it. ...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Need Help With a Deadlock Issue

    That's not a very nice trigger.

    Frank Lain (12/6/2007)


    select @key = cashlist_key from INSERTED

    What happens if more than one row is inserted in a batch?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Free T-SQL Query Tool

    SQL Server Express Management Studio?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Probably simple but maybe not? need help with a select statment

    Ramesh (12/6/2007)


    Jai,

    I appreciate your feedback but, dynamic SQL is not always the best choice, but the last choice if all else fails!!!!!

    Performance-wise, with this kind or requirement it sometimes...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Creating Index: Got Error

    Do you have a recent database backup? How critical is the data in that table?

    You have some corruption in your data file, probably a data page that's damaged.

    Run the following...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Probably simple but maybe not? need help with a select statment

    Perfomance-wise it's a bad idea to change the value of parameters in a proc before using them. Confuses the optimiser's row estimates.

    Rather define a local variable, set the variable's value...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Index design on a table where the primary key is not clustered

    TheSQLGuru (12/5/2007)


    I personally LOVE such situations (and countless others out there)!!! It is one of the main reasons my services are in such high demand. 😎

    If I was contracting...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Event class in Trace

    Not from the trace itself, as far as I know. What you can do is create a lookup table with the event ids and the text values, then join the...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 48,091 through 48,105 (of 49,552 total)