Forum Replies Created

Viewing 15 posts - 48,706 through 48,720 (of 49,552 total)

  • RE: custom Profile Table

    First thing, remove that cursor. It's not necessary. This will do exactly the same as that entire cursor.

    INSERT dbo.custom_Profile (UserId

    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: Drop and Create column in the same position (TSQL), as it was before dropping

    Only by doing it the way management studio does, by creating a new table, copying the data over and dropping the old column.

    Have you tried Alter Table Alter Column? I...

    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: 101 level question - "Statistics" / Indexes

    If you have an index on a column, you will always have statistics on that column as well. They will be updated automatically from time to time.

    You can create statistics...

    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: Why the difference in execution plans between development and production servers?

    Ah, sorry fot the misread. Yeah, that's fine.

     

    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: Regarding a deadlock scenario

    a) recompiles (MANY more than you might suspect, since IIRC for every 6 rows you insert/modify, the code referencing the temp table will be recompiled).  This gets expensive.

    Plus every time...

    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: Why the difference in execution plans between development and production servers?

    It's still getting updated with each insert and you could be see a lot of thrash on the system from it reorganizing to ensure that it's at 100%.

    Fill factor...

    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: Regarding a deadlock scenario

    Processes blocking themselves is not a problem. It happens when a process parallels and then has to wait for one of the spawned threads to merge the threads.

    Regarding the deadlock,...

    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: SQL Query Prob

    Try this

    SELECT ...

    From ScoutingReport as sr

    Join Person as p on p.Id = sr.ScoutedPersonID

    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: SQL Server matching using like

    SELECT * FROM tbl WHERE col not like 'ABC%' and COL not like 'DEF%'

    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: Tables Lost

    Restore a backup, restore the tran logs and stop just before the 'drop'

    Then you can find whoever wrote that code and give then a good wack upside the head for...

    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 types - Unexpected results

    It's highly unlikely to see much of a change in speed for a data type change.

    If you haven't rebuilt the clustered index, then the data will still occupy 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: Please help me to create the sample query

    Yes, but will either need a cursor or a hard-coded limit on how deep the hierarchy will go.

    Which is your preference?

    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: WriteLog lastwaittype

    Got connection pooling in place? That would account for the remaining connections. Reusing an open connection is faster than opening a new.

    As for the slow down, there could be hundreds...

    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: WriteLog lastwaittype

    A connection will stay open until it's explicitly closed. SQL doesn't close them automatically. If they're awaiting command, then they are idle.

    There's a column in sysprocesses waittime and another lastwaittype....

    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: Please help me to create the sample query

    Are you using SQL 2000 or 2005? It's very easy on 2005 but on 2000 it can be quite tricky.

    How deep can the hierarchy go?

    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,706 through 48,720 (of 49,552 total)