Forum Replies Created

Viewing 15 posts - 6,676 through 6,690 (of 49,552 total)

  • RE: Which of these indexes should be deleted?

    umarrizwan (1/28/2015)


    DECLARE @dbid INT

    SELECT @dbid = DB_ID(DB_NAME())

    SELECT OBJECTNAME = OBJECT_NAME(I.OBJECT_ID),

    INDEXNAME = I.NAME,

    I.INDEX_ID

    FROM SYS.INDEXES I

    JOIN SYS.OBJECTS O

    ON I.OBJECT_ID = O.OBJECT_ID

    WHERE OBJECTPROPERTY(O.OBJECT_ID,'IsUserTable') = 1

    AND I.INDEX_ID NOT IN (

    SELECT S.INDEX_ID

    FROM SYS.DM_DB_INDEX_USAGE_STATS S

    WHERE S.OBJECT_ID...

    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: Is the DELETION of a SQL Server 2008R2 database logged anwhere?

    Should be in the default trace, but that's only 5 files of 20MB, it gets overwritten quickly.

    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: Are the posted questions getting worse?

    venoym (1/28/2015)


    An index on the ID (even unclustered) would solve the speed up the ordering problem with the TOP (1), but you could also would have add an "ORDER BY...

    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: Select Alternate number of rows

    ChrisM@Work (1/28/2015)


    It returns every row:

    SELECT

    n,

    [AllZero] = n%1,

    [(n-1)%2]...

    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: Select Alternate number of rows

    Bhushan Kulkarni (1/28/2015)


    Optimized one..

    USE [AdventureWorks2008]

    GO

    SELECT P.*

    FROM

    Person.Person P

    WHERE

    P.BusinessEntityId & 1 = 0

    That doesn't return alternate rows, it returns rows with odd even values of BusinessEntityID. There's a...

    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: Deadlock issue

    Chris-475469 (1/28/2015)


    To be honest I'm not sure. I'd have to check with the developers regarding that as to whether there is a specific reason.

    I'd bet you lunch that they won't...

    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: Deadlock issue

    Any reason why all but one of those connections are running in the Serializable isolation level? Is that intended? Do you need the isolation that serializable provides?

    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: Does log shrink would affect any process happenning

    Well, that's a nice example of database abuse....

    Yes, that'll have multiple effects.

    First you've broken the log chain of the database and lost the ability to do point in time restore.

    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
  • RE: Server/database consolidation questions

    JarJar (1/28/2015)


    How many instances per server?

    In my opinion, 1 unless you have a good reason.

    The only advantages of multiple instances over multiple DBs on an instance are memory partitioning,...

    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: Can I use check constraint with unique constarint with other

    Why not just change the column f2 to not be nullable?

    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: Comparing Tables (Match, Exists, and Not Exists)

    Err, yes it is possible.

    Query splits the sentences into words (look for a split function, Delimited8ksplit is fastest). If large, insert into temp tables, then use INTERSECT and EXCEPT to...

    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 for SQLServer Query

    Table definitions please, some sample data and what is it supposed to do?

    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: Are the posted questions getting worse?

    Grant Fritchey (1/26/2015)


    What it's like, at this exact moment, everywhere in Massachusetts.

    Summer, glorious summer.

    Might swing past my parent's place tomorrow for a swim, it's going to be a hot...

    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: Is there such a backup configuration you know of that can eliminate the impact backups have in the system?

    Backups do not take locks. Full stop. End of story.

    Yes, in my experience backups do usually have some impact on the system. To be honest that's pretty unavoidable. It is,...

    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: Is there such a backup configuration you know of that can eliminate the impact backups have in the system?

    Starting with the basics. Backups do not take locks, so the timeouts can't be from there.

    Before looking for a solution, I'd suggest identify the problem. Why do queries time out?...

    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 - 6,676 through 6,690 (of 49,552 total)