Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Ok, so it sort of is about SQL.... Expand / Collapse
Author
Message
Posted Monday, April 22, 2013 7:33 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 8:01 AM
Points: 1,651, Visits: 5,201
Sean Lange (4/22/2013)
mister.magoo (4/19/2013)
Sean Lange (4/19/2013)
I had to dig around a bit to find this one. One of our legacy tables replicated from the Main Frame has a table that nobody really knows it is for but...

There is a column ConstantC char(1).

Anyone want to take a guess what value you will find in all 1.2 million rows???

Not only do we have 1.2 million copies of the same value, just using the column is 9 or 10 extra keystrokes than just using the actual constant from the keyboard.


Please tell me there is an index on it as well!


No the table is a heap!!! I have been asking around and nobody knows what the table is even used for.


Oh, that's a shame, an index on 1.2 million repetitions of "C" would have been sooooo nice


MM


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1444983
    Posted Monday, April 22, 2013 7:35 AM


    SSChampion

    SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

    Group: General Forum Members
    Last Login: Today @ 1:37 PM
    Points: 11,965, Visits: 10,992
    mister.magoo (4/22/2013)
    Sean Lange (4/22/2013)
    mister.magoo (4/19/2013)
    Sean Lange (4/19/2013)
    I had to dig around a bit to find this one. One of our legacy tables replicated from the Main Frame has a table that nobody really knows it is for but...

    There is a column ConstantC char(1).

    Anyone want to take a guess what value you will find in all 1.2 million rows???

    Not only do we have 1.2 million copies of the same value, just using the column is 9 or 10 extra keystrokes than just using the actual constant from the keyboard.


    Please tell me there is an index on it as well!


    No the table is a heap!!! I have been asking around and nobody knows what the table is even used for.


    Maybe I will add a clustered index.

    Oh, that's a shame, an index on 1.2 million repetitions of "C" would have been sooooo nice


    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Moden's splitter.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
    Understanding and Using APPLY (Part 1)
    Understanding and Using APPLY (Part 2)
    Post #1444986
    Posted Tuesday, April 23, 2013 9:56 AM


    SSC-Insane

    SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

    Group: General Forum Members
    Last Login: Today @ 10:51 AM
    Points: 20,458, Visits: 14,078
    Sean Lange (4/22/2013)
    mister.magoo (4/22/2013)
    Sean Lange (4/22/2013)
    mister.magoo (4/19/2013)
    Sean Lange (4/19/2013)
    I had to dig around a bit to find this one. One of our legacy tables replicated from the Main Frame has a table that nobody really knows it is for but...

    There is a column ConstantC char(1).

    Anyone want to take a guess what value you will find in all 1.2 million rows???

    Not only do we have 1.2 million copies of the same value, just using the column is 9 or 10 extra keystrokes than just using the actual constant from the keyboard.


    Please tell me there is an index on it as well!


    No the table is a heap!!! I have been asking around and nobody knows what the table is even used for.


    Maybe I will add a clustered index.

    Oh, that's a shame, an index on 1.2 million repetitions of "C" would have been sooooo nice


    How about adding a filtered index




    Jason AKA CirqueDeSQLeil
    I have given a name to my pain...
    MCM SQL Server


    SQL RNNR

    Posting Performance Based Questions - Gail Shaw
    Posting Data Etiquette - Jeff Moden
    Hidden RBAR - Jeff Moden
    VLFs and the Tran Log - Kimberly Tripp
    Post #1445545
    Posted Tuesday, April 23, 2013 10:00 AM


    SSCertifiable

    SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

    Group: General Forum Members
    Last Login: Today @ 10:42 AM
    Points: 6,544, Visits: 8,757
    SQLRNNR (4/19/2013)
    Jeffrey Williams 3188 (4/18/2013)
    But...what if truncate doesn't actually remove everything that was there before? Don't we have to be sure we delete it before we insert?


    Obviously truncate means randomly delete data iif you feel like it.


    Well, that inline if does stuff like that!


    Wayne
    Microsoft Certified Master: SQL Server 2008
    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
    CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings
    Post #1445551
    « Prev Topic | Next Topic »

    Add to briefcase ««12

    Permissions Expand / Collapse