Forum Replies Created

Viewing 15 posts - 3,466 through 3,480 (of 49,552 total)

  • RE: How to get only the last string before comma

    You want the string after the last comma?

    The one before the last comma would be LoanDate

    DECLARE @str VARCHAR(250) = 'DWDate,Email,UserID,ID,LoanNum,PersonEmail,LoanDate,Paymt'

    SELECT REVERSE(LEFT(REVERSE(@str), CHARINDEX(',', REVERSE(@str))-1))

    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: Dealing with large tables (Financial transactions)

    That can work.

    Alternately you could aggregate the stuff you remove from the current table and just store the aggregated results if you don't need the details. Other option would...

    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: Cannot drop the table 'TABLE' because at least part of the table resides on an offline filegroup.

    prettsons (3/14/2016)


    Add a new file into filegroup then empty the first file by DBCC SHRINKFILE.

    You can't do that if the filegroup is offline, and besides, the OP stated that 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: Truncate All Tables

    Please note: 8 year old thread, and the author hasn't logged in in 3 years.

    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: Changing data type to optimize performance

    nadersam (3/14/2016)


    The buffer hit ratio is always 1 or 0.99, and the buffer cache hit ratio base is highly variant.

    Buffer cache hit ratio is nearly useless as a counter.

    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: Cannot drop the table 'TABLE' because at least part of the table resides on an offline filegroup.

    Last time I saw this it did indeed turn into a catch-22 (worse in the other case as it was a production DB and the missing filegroup was completely missing)

    As...

    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: Auto generated SQL code

    You're going to have terrible performance, even if you only have one or two of those. Terrible and erratic performance.

    https://www.simple-talk.com/content/article.aspx?article=2280

    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: File in Use

    After the fact, you don't. At the time it occurs, you could use something like Process Explorer to identify what has the file handle open.

    Make sure your antivirus is correctly...

    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: High Buffer manager\Page reads/sec but zero Memory Pages/sec

    No, they're not both measuring pages read from disk. They're measuring completely different things

    Memory\\Pages/sec is the rate at which pages are read from or written to disk to resolve hard...

    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: check sum function

    Did you try the documentation? https://msdn.microsoft.com/en-us/library/ms189788.aspx

    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 & Actual Plan

    The nonclustered index is smaller, since it doesn't have the name column in it. Hence for a query that only references the ID column anywhere, the nonclustered index is slightly...

    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 database creation from ldf (Log Transaction File)

    There is no solution to that. A log file is unlikely to contain all of the changes made back to the DB's creation, and you can't play it forward alone....

    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: Full, Differential, and Log backups run at same time. Which runs first?

    Full and log can run at the same time, so can diff and log. Diff and full block each other, so which ever starts first will run to completion first.

    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: DBCC Shrink

    risingflight143 (3/7/2016)


    I am running out of disk space so i need to cleanup

    Then look for old files you can delete or move, and ask about getting more drive space.

    Shrinking DBs...

    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: Default constraints OR INSERT trigger for Audit columns (create date time/user)

    Defaults. When you're creating a row and a column should go to a particular value, use defaults. If you need to set a column to a particular value when 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 - 3,466 through 3,480 (of 49,552 total)