Forum Replies Created

Viewing 15 posts - 21,496 through 21,510 (of 49,552 total)

  • RE: Are the posted questions getting worse?

    Revenant (12/29/2011)


    Just a few thoughts:

    External drives are insufficient - think a fire in the computer room.

    USB drives are slow and they represent security risk. Our prod servers have USB ports...

    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: Fragmentation and ALTER INDEX REBUILD/REORGANIZE not resolving it

    p.s. Singleton lookups are the one thing that won't be affected by fragmentation at all.

    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: Fragmentation and ALTER INDEX REBUILD/REORGANIZE not resolving it

    That 35% fragmentation is in a non-leaf level of your index, a level that has much fewer pages than the leaf and will be much less affected by fragmentation anyway...

    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: choose a random record

    Oh, another way to get 50 random rows, one at a time with no repeats:

    CREATE TABLE #Random (

    Seq INT IDENTITY,

    name_emp varchar(50)

    )

    INSERT INTO #Random (name_emp)

    SELECT TOP (50) name_emp...

    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: choose a random record

    Dev (12/29/2011)


    It will repeat but not toooo frequently.

    3 times in 10 rows in one test I did.

    Does random mean not to repeat the value in 50 attempts? 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: choose a random record

    xRafo (12/29/2011)


    how would you do that?,

    maybe a good idea!

    Create a table for values you've already seen (just the PK column) and then exclude those from the query.

    Something roughly like this

    SELECT...

    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?

    Stefan Krzywicki (12/29/2011)


    GilaMonster (12/29/2011)


    Stefan Krzywicki (12/29/2011)


    I don't have room on my machine either.

    Two words: External harddrive.

    Seriously, I've had to do that once or twice.

    I can't even get them to buy...

    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: choose a random record

    Dev (12/29/2011)


    Place rand() * 100 function in your WHERE clause.

    Example:

    WHERE some_int_column= rand() * 100 -- or cast it as INT

    That's not more or less random than ordering 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: choose a random record

    How random do you need that row, and how large is the table? Is there an identity column?

    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?

    GSquared (12/29/2011)


    Stefan Krzywicki (12/29/2011)


    I suppose it doesn't help that sometimes re-attaching the database files works, like if you're re-installing SQL Server and just make sure the files are where they...

    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?

    Stefan Krzywicki (12/29/2011)


    I don't have room on my machine either.

    Two words: External harddrive.

    Seriously, I've had to do that once or twice.

    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 (12/29/2011)


    GilaMonster (12/29/2011)


    Grant Fritchey (12/27/2011)


    Based on the fact that we can't get people to run good sets of backups despite Umptymillion articles, blog posts, presentations, webcasts and screaming lightning...

    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: choose a random record

    There are a few ways, depends how random you need it. This one's not particularly efficient, will give you a different row each time.

    SELECT TOP (1) name_emp FROM employees ORDER...

    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: Database in 'Recovery Pending' State -Error 945

    Vertigo44 (12/29/2011)


    Is there a way for me to tell if the database was cleanly shutdown or not? I know that the state is 'RECOVERY PENDING' since the LDF file 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: Are the posted questions getting worse?

    Grant Fritchey (12/27/2011)


    Based on the fact that we can't get people to run good sets of backups despite Umptymillion articles, blog posts, presentations, webcasts and screaming lightning talks, I don'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

Viewing 15 posts - 21,496 through 21,510 (of 49,552 total)