Script to find word stacks in InDesign

CS6, InDesign -- I've been looking for a proofing script that finds word & letter stacks and highlights items found & would be easily removed once items have been reconciled.

While this scripting forum is a great place to get scripting help, it's also very easy to misuse it. Please bear in mind that for most (if not all) of the participants here, writing scripts is a source of income. If someone writes a particularly useful script, don't be shy to offer money (privately)! Also, please do not expect that complete scripts will be written for you (although in many cases they will be). If you are a novice scripter and show an interest in learning, you will generally find that the help you recieve will be much more positive.
Here's a short list of "Dos" and "Don'ts" to keep in mind...
Do ask for help in automating your work in InDesign, but Don't expect a full solution for free.
Do show an interest in learning, and people will probably try to help you, butDon't ask for other people to solve all your problems for you.
If you need a script written for you, Do ask if someone is available to write one for pay, but Don't keep such an issue on the forum. Work it out off the forum please.
Please Do thank others who spend the  time to solve your issues, and pleaseDon't expect every issue to be solved on a public forum. Many solutions have  taken a lot of programming time to work out, and it's not reasonable to  expect such solutions to be given away for free.
Please Do give code examples to help other people, but please Don't pass off others code as you own!
Please Do make a note in the topic of a new thread of what language you are using as well as the version number that you are using such as: [JS][CS3].
Please Don't branch off a discussion in the middle to a new topic -- please start a new one!
Please Don't start two discussions on one topic -- it makes it very confusing!

Similar Messages

  • Start script automatically after place Word text in indesign document

    I need start a script, automatically, after plece Word text in indesign document...
    It's possible ???

    This is how I'd approach it - it captures a 'place' or 'paste' of a blob of text. It is not perfect - it will also 'fire' if you simply copy some text from one frame in the document to an empty frame, but I don't think that would be an issue in most cases.
    Create a page item on the pasteboard; use the Active Page Item Developer palette to set the List of Subjects to * (just an asterisk), and the Event Filter to subjectModified* ('subjectModified' with an asterisk appended). Set the attached ExtendScript to the script shown below.
    I've not tested this heavily - it's only a proof of concept...
    (function(theItem)
      const kKeyForSavedTextLength = "com.rorohiko.savedTextLength";
      do
        var theFrame = theItem.eventSource;
        if (! (theFrame instanceof TextFrame))
          // Not a text frame - bail out
          break;
        var previousTextLength =
          theFrame.getDataStore(
            kKeyForSavedTextLength);
        if (previousTextLength == null)
          previousTextLength = 0;
        if (previousTextLength > 0)
          // Already has text in it - bail out
          break;
        var curTextLength = theFrame.contents.length;
        theFrame.setDataStore(
          kKeyForSavedTextLength,
          curTextLength);
        if (curTextLength == 0)
          // No text in it - bail out
          break;
        alert("Pasted or placed a blob of text");
      while (false);
    (theItem));

  • Scripts you find useful

    Just wanted to get maybe a few new free scripts and wondering if anyone is willing to share any links or code of cool scripts they have in their arsenal that just makes things easy for them.
    Here's some of my favourties that I've accumulated over the years
    Apply Clipping Path
    For some reason clipping paths may or not be applied to your photohsop files. If you turn on or off the clipping path for one image, then select the rest of the images and run the script it will apply or unapply the clipping path!
    Create Hex Swatches
    Speaks for itself really
    http://indesignsecrets.com/create-hexadecimal-color-swatches-in-indesign-for-interactive-d ocuments.php
    Footnotes to Endnotes
    Various reasons for doing this, mainly because indesign can't handle spanning footnotes across two columns!
    But it's very handy and has a lot of uses!
    http://www.kahrel.plus.com/indesign/foot_to_endnote.html
    This script takes it one step further by creating the cross-reference, if you need that functionality
    http://www.kahrel.plus.com/indesign/foot_add_delete.html
    *****FAVOURITES COMING UP******
    Multipage Importer
    Import and place multiple PDF pages or InDeisgn Pages directly into your indesign document!
    http://indesignsecrets.com/zanelli-releases-multipageimporter-for-importing-both-pdf-and-i ndd-files.php
    Preptext
    There others mentioned in the link below. But Preptext is fantastic for taking in Word file that has no styles applied to it's text and it creates the bold, italic, bold italic, superscript, subscript or any other character formating into Character Styles!
    It's really fantastic!
    http://indesignsecrets.com/free-scripts-help-fix-word-formatting.php
    Smart Title Case
    You can edit the script easily enough and follow the format to add in your own conjunctions, or to add in your own intentional capital letters.
    The link to download is on the left
    http://jsid.blogspot.ie/2006/06/smart-title-case-revisited.html
    Table Sort
    Does what it says on the tin - it sorts a table, quite nifty!
    http://www.kahrel.plus.com/indesign/tablesort.html
    Data merge into a table
    InDesigns Data Merge is quite powerful but it doesn't allow data merging into a table, say for a table plan of guests or something like that.
    This resolves that issue
    Follow the instructions carefully!
    http://indesignsecrets.com/using-data-merge-to-create-a-table-for-a-directory.php
    Replace Text
    Have to replace your text with Lorem Ipsum for some reason? I requested this script and you follow the thread below
    http://forums.adobe.com/thread/574682
    Stylighter
    Highlights styles within text - I find it handy for if you need multiple people to proof text - but there's bound to better uses than that!
    http://indesignsecrets.com/style-highlighting.php
    Batch Convert
    This is Golden! You can select a folder of InDesign files and choose an output method, from IDML, to Package, to JPEG, to whatever else is mentioned in the conversion options.
    Tips:
    Set your JPEG export options by exporting a sample page first. As you don't get a dialog to choose what JPEG settings you want to choose, it uses the last JPEG setting you choose.
    Setup a PDF export option so it's available to choose if you're batch exporting PDFs.
    Run with no documents open to select a folder. Run with a lot of documents already open and it will use them.
    http://www.kahrel.plus.com/indesign/batch_convert.html
    Finally!
    PageExporterUtility
    It basically lets you select what pages to export to a specific format - it's very handy and easy to use.
    I use it mostly for RTFs as InDesigns RTF export is a bit dodgy.
    (the Batch Convert above for RTFs of multiple files is just pure golden!
    http://www.rrdonnelley.com/prepress/prepare/indesign/indesign-exporter-utility-script.aspx
    That's it
    Hope to hear from the rest of you guys on the scripts that make your life handier while using InDesign!

    Good idea for a thread!
    One script that I use regularly and is very useful is the late Teus de Jong's HyphenationChecker. This displays a complete list of all hyphenated words used in a document so that you can double-check them at a glance. Available here:
    http://www.teusdejong.nl/thome/ho_body5.html#hyphen
    I also must mention a couple of my own freebies, both of which I use regularly. I'll just copy the blurb from my site:
    Quick Apply with Next Style
    Have you always wished that the quick-apply feature would respect your paragraph style’s Next Style setting? Have you always wished that there would be an easy shortcut for Next Style? Well, now there is!
    Case Cycle
    This little script is a great timesaver. It simply cycles through three of InDesign’s capitlization options: All caps, lowercase, sentence case.
    They can both be accessed from this page: http://www.freelancebookdesign.com/scripts

  • Importing Microsoft Word doc to InDesign with embedded EPS art ~ scaling issue

    Hi, my workflow calls for creating content in Microsoft Word 2010 with embedded EPS art, in this case MathType 6.7a math objects. When I import these manuscripts (after saving as Word 97/2003 format) into my Adobe InDesign CS5.5 templates, the embedded inline graphics have been resized. Strangely, InDesign is keeping the container frame at the correct dimensions and then upsizing or downsizing the art inside that box.
    When I export a sample graphic from the Word file and unembed the same graphic after import it into InDesign, the two graphics are different sizes. InDesign might increase the size of one embedded graphic by 400% and then scale it down to 25% inside the anchored picture box and then in the next anchored picture box it might decrease the size the art to 50% and scale it to 200%.
    I did a test and created a graphic in Adobe Illustrator, saved it as EPS, placed the graphic into a Microsoft Word 2010 document, saved it out to 97/2003 format, imported that doc into an empty Adobe InDesign CS5.5 file. Again! InDesign changed the size of the art and re-scaled it to appear the same.
    I've been able to duplicate this issue on InDesign CS4 also, on both Windows XP and Windows 7.
    Has anyone else run into this issue? Does anyone know why the InDesign import filter doesn't import inline art in a Word document at 100%? Thanks for the help!

    My solution for this is:
    1. Place *.docx (yes, docx) word document with mathtype equations into indesign. This will set correct baseline for equations which is very important.
    2. download this scalegraphics script http://in-tools.com/downloads/indesign/scripts/ScaleGraphics.zip
    3. copy script from zip folder to C:\Program Files\Adobe\Adobe InDesign CS4\Scripts\Scripts Panel\Samples\JavaScript
    4. open palet (window/autoamtion/scripts) scripts, find new sript and run it
    Voila, all equations is at 100%...
    Script explanation: http://in-tools.com/article/scripts-blog/scale-graphics-script/
    In links palete equations have eps extension but this is embeded wmf files so you cant open them in photoshop or distill it with distiller.-((( I use export to pdf option in indesign to make pdf file.
    If you want all this eps links to export from indesign use this method:
    1. in links palete select all links
    2. in palete menu choose "unembed link"
    3. on answer window choose "no"
    4. select folder where you want indesign save files
    5. press "select"
    6.  now you have all links in new folder unembed from indesign document and you can edit it with mathtype.

  • Script to find/replace regular to Italic based on search terms in .txt

    Sorry for such a newbie post.
    I have been reading on JS scripts for find/replace.  I'm hoping develop a script or find one that is written that
    1. Looks into a .txt or any searchable file format, containing search terms
    2. Script will run on the entire Indesign document
    3. For any matching search terms script replace the style from regular to Italic, or from Bold to Bold/Italic. 

    Perfectly doable. Do you want to give it a go yourself?
    A few first thoughts (things I'd probably solve myself while writing the script):
    1. JS can read any file, but getting just the plain text out of an MS Word document is kind of ambitious -- even for me. Keep it simple: if your search text is nothing but a list of keywords or short phrases, write them out in a plain text file, one search item per line.
    2. With that I presume you mean not on one single continuous story, but all over the file -- including loose text frames, master pages, and what-have-you-got. Thass' easy, you can set the target for a Find or Replace operation with pin-point accuracy.
    3. .. This is the interesting part, actually.
    (a) Do you want to change the text style? That will set an override "+" for the modified text. It would be safer (wiser, etc.) to change it using a character style. (For the script it doesn't matter which method you use, this is just for the Future You who is going to edit this file in 6 months.)
    (b) If you do use a character style: what should happen if there already is one applied? Not bold or italic, but underline, for instance. Applying a new char style will override this one.
    (c) The naive approach (which I probably would have taken first) is to first search for each of the search terms, go over the 'found' list and test for each single entry if it's in regular or bold, then take appropriate action.
    A better approach -- without knowing anything else about this document -- could be to blindly use Replace to change ALL search terms in "Regular" to "Italic" and ALL search terms in "Bold" to "Bold Italic". It sure would be faster.
    (d) Just like in the interface, you can search for a word and 'change' only the formatting -- no need to change the text as well. And just like in the interface, you need to specify "whole words" and/or "case sensitive".

  • PowerShell script to find a string of characters in office documents in Doc Libraries and List Item attachments?

    Hi there,
    For SharePoint 2010 site - Does someone have the PowerShell script to find a string of characters in Office/Word/Excel/PDF documents in document libraries or the ones attached to List Items?
    Thanks so much in advance.

    Hi,
    According to your description, my understanding is that you want to find some specific string character in list items using PowerShell Command.
    $w = Get-SPWeb "http://devmy131"
    $l = $w.GetList("http://devmy131/lists/fieldslist");
    $i = $l.Items[0]["Title"].ToString();
    if ($i -like '*document*')
    Write-Host "Title contains document character" $i;
    More information:
    PowerShell -contains -like
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • A Script to Find and Replace Layer Names

    Are there any scripts to find and replace layer names?
    There is an excellent script available for Photoshop which allows you to not only replace words in layer names, but also insert words as Prefixes, Suffixes and Sequential Numbers.
    The illustrator version of this script only allows sequential numbering: It doesn't offer find and replacing of words.
    Ideally, it would be great if there was something that could do multiple find and replaces in one go:
    (e.g.
    You have layers like this Car, Dog, Bat
    You enter: car(Option1), dog(Option2), Bat(Option3)
    Your layers then become: Option1, Option2, Option3).

    big_smile, that's a very good start! Step 1 of Learning How To Script is indeed, adjusting an existing simple script to make it do more complicated things. (And usually then "break something", which is also a required part of the process.)
    You are correct in your observation this is repetitive stuff. For one or two different items that wouldn't be a problem, but in longer lists you soon get lost.
    The usual way of working with find-change lists is to build an array:
    var layernames = [
    [ 'FHairBowlBoy *Hair', 'Hairboy1' ],
    [ 'FHairCurlyafroBoy *Hair', 'Hairboy2' ],
    [ 'FHairSpikyBoy *Hair', 'Hairboy3' ],
    The general idea is to loop over all names, check if the current layer name is "layernames[i][0]" (the left column) and if so, rename it to "layernames[i][1]" (the right column). If you know how to write a loop in Javascript, then you can implement this right away.
    However ..
    A more advanced way to do this doesn't even need loop to over all layernames -- instead you can immediately "get" the correct name per layer! It's magic! Almost!
    The trick is to use a Javascript object instead of an array. Javascript objects are nothing special; Illustrator's 'layers' is an array of objects, and each object "layer" has a property "name", whose value you can read and set. What I do here is create a new object, where the "name" part is the original layer name and its value is the new layer name. All you need to check for per each layer is if there is a property 'object.originalLayerName', and if so, assign its value to that layer name.
    This looks a bit like the array above, except that (1) you use {..} instead of [..] to create an object, and (2) you add "name:value" pairs instead of "value" only (actually, the 'name' of a value in an array is simply its number).
    So this is what it looks like:
    // JavaScript Document
    var doc = app.activeDocument;
    // name indexed object
    var layernames = {
    'FHairBowlBoy *Hair':'Hairboy1',
    'FHairCurlyafroBoy *Hair':'Hairboy2',
    'FHairSpikyBoy *Hair':'Hairboy3'
    // loop through all layers
    for (var i = 0; i < doc.layers.length; i++)
    //Set up Variable to access layer name
    var currentLayer = app.activeDocument.layers[i];
    if (layernames[currentLayer.name])
      currentLayer.name = layernames[currentLayer.name];
    Enjoy!

  • Automatic update from Word source into Indesign

    Hi I have followed all threats and cannot seem to find a solution to my query.
    I have to complete a 280page annual report within a very short period of time. Based on the client it seems that there will be multiple changes on content after layout is completed. Is it possible to import the Word docuement into Indesign and when the client makes changes in the original Word docuement the changes are affected directly in Indesign?
    I had a look at the XML options and discussions but being a lyout designer the explenations of tags etc mean zero.
    Obvioulsy I would re-edit stylesheets and layout styles in Indesign but would ideally then like to export the content / link the content to the original file so that the client can make changes in Word and I do not have to manually re-layout pages or make changes from proofs.
    Please can someone indicate whether this is at all possible and wether you have to have knowledge of scriptig etc should it be possible.
    VERY URGENT RESPONSE PLEASE.

    In the Preferences, you can select to treat a placed Text document just like an image: you get a link in your Links palette, and if the original file is modified, you can "update" it just like an images.
    However: the text will re-import just like it did the very first time -- including the formatting of the text. If you formatted the text in InDesign, that will be lost. A very rigid workflow is the solution in that case: if your editor uses Word Styles, and he did so consequent and correct, you can automatically have them mapped to your styles in the InDesign document. You can actually help your editor getting the good styles by exporting your text to RTF, so he can work on it and then return the document.
    Try before you fly.

  • Opening Word docs in InDesign CS4 (Mac). It keeps crashing.

    Hello everyone.
    I have just upgraded to CS4 from CS2 (Mac) and I have been having numerous issues with Word and InDesign. When I try downloading a fairly complicated Word file into InDesign CS4 it crashes. But, if I open it in InDesign CS2, it opens fine. I then take the ID CS2 file and reopen it in InDesign CS4 and it works. Though this maybe a good workaround, it isn't something I can be doing all the time, its way too time consuming. Does anyone have an idea what the problem is? Or, what I can do about it?
    As a note: I have also just upgraded my systems to Mac Pros and iMacs with Leopard on it.
    Any assistance would be greatly appreciated.

    Thanks for the info. I have had this file opened in lower versions of CS with no issues. It seems like every few files this is happening to. All my current systems have two gigs of Ram.
    I was suspecting (dreading) that it may be a font conflict. I know the system fonts (dfonts) have been somewhat an issue in previous versions of CS, but I never had crashes to InDesign before because of font conflicts. I will try sorting through my fonts and breaking-up the file.
    Thanks again for your guys help. I'll let you know if I find anything out.

  • Importing a 900 page MS-Word document to InDesign CS 6

    The Word document has course descriptions of all the classes offered at a community college. The need is to have two columns(textboxes of equal size)
    in each page of the InDesign document and then bring the information from the Word document to InDesign so that when it is printed, it can be like information in a telephone directory as
    Page 1
    Column 1 data Column 2 data
    Page 2
    Column 1 data Column 2 data
    and so on.
    The Word document is like
    Page 1
    Page 1 data
    Page 2
    Page 2 data
    I understand using the Place option in File menu, the Word document can be imported, but how can the information be
    brought over so that it flows in the two columns of each InDesign page. If I do an import now, the InDesign pages are like
    Page 1
    Page 1 data
    Page 2
    Page 2 data
    I selected the Import options while using the Place option in File menu and chose
    Use Indesign formatting in case of a conflict.
    1. Is there a way to bring the information from the Word document so that it flows in the two columns of each InDesign page without loss of formatting? The MS-Word document has bold text, headings, sub-headings etc.
    I would appreciate any suggestions.

    Thanks Peter,
    I found it in Story Editor View, took the text(Cut) and tried pasting it in the next line, but did not work. I pasted the text to Notepad so that formatting is removed, then tried pasting it in InDesign, but it still did not paste.
    How can I find out what is causing it and how can it be fixed?
    The Word document has all the information in a table(with no borders). I cannot get ID to import it. I tried "Remove styles and formatting from text and tables" option in Show Import Options, "Remove styles and formatting from text and tables" option with Preserve Local overrides checked so that tables can be converted to unformatted tables or unformatted tabbed text, but it did not work.
    Thanks a lot for your prompt responses and time in this thread.

  • [CS4] Ann.: Wordalizer 1.25 "Create Word Clouds in InDesign"

    Marc Autret is way too modest -- he posted this announcement in the middle of a long thread in the Scripting forum, and I'm sure it deserves much more attention than that!
    http://www.indiscripts.com/post/2010/04/wordalizer-125-create-word-clouds-in-indesign
    -- a marvelous script that rips right through your text and creates a "Word Cloud" of the most (or least!) frequently used words in your document, book, clipboard text, or wherever! Supports 'common word' removal in six different languages (so you don't end up with a giant "The" in the center), and has lots of tuning options.
    The freely downloadable version already has enough options to get excited about, and the Pro version has even more advanced editing options.
    Wordalizer speaking about itself:

    WOW! What a praise! Thank you so much Theunis
    > Is there a way to include spaces between words or special characters  (like bullet)?
    Yes and no! With the exceptions of hyphens, the text parser ignores most of the ‘non-alphabetic’ characters [note: the alphabet depends on the selected language.] That's to say that bullets, spaces --including every non-breaking spaces, sorry!--, and any similar characters are regarded as word separators. The dialog box provides the option ‘Allow digits’ though:
    However the PRO version allows you to insert extra characters through the word list editor, which supersedes the parser restrictions. So you can create a word cloud with bullets, space separated words, or anything else, by entering something like this:
    • word1 • : 100
    word1 word2 : 50
    #)$^*% : 20
    Then you get:
    Finally there is a secret tip allowing the user to inject a weighted word list containing weird characters, even with the TRY version:
    1) Create a text frame in InDesign. (This tip also works with imported text file, or clipboard source.)
    2) Enter your entries using the weighted list format:
    entry1 : weight
    entry2 : weight
    etc.
    3) Run the script and check "Active Text Frame" in the Source panel.
    4) Press OK. (Enjoy!)
    Last note: Wordalizer supports InDesign CS4 and InDesign CS5 ;-)
    Thanks again,
    Marc

  • I am enrolled in an online university program that uses Sakai. Fire Fox updated something that attaches computer script to my Word documents when I upload them.

    I am enrolled in an online university program that uses Sakai. Fire Fox updated something that attaches computer script to my Word documents when I upload them. I use a PC and Word 2010

    sigh...this is quite idiotic, but I have found a solution. It was quite simple, really, and yet quite idiotic. I share it for all those reading so that, if you know of anyone else that did what i did, you can easily be the "hero" in their lives.
    After a continued search via youtube or what have you for any possible solutions, I kept coming back to the fact that I was told by my computer that I didn't have "permission" to do the file deletion. I stumbled upon a youtube video that talked about "unlocking", "locking", certain files and what not.
    Long story short, the reason why I couldn't do anything to the files that were on my desktop was due to my "locking" the desktop folder. I must have done this a while back not knowing what I was doing nor the ramifications of clicking a simple box.
    I undid this by:
    Opening Up Finder
    then, going to MacHD --> Users --> My Account Folder
    clicking on Desktop Folder, I "cmd+I"
    I then, unclicked the "locked" option
    I went down to the cog/settings and selected "Apply to enclosed items"
    resulting then in having all my files on my desktop free accessiblity and delete-ability....
    oi...at least I now  know what "locking" a folder (even the desktop folder) can do to other files held within it

  • Text formatting issues from MS Word 2011 to InDesign CS5.5

    Is there anyway to copy and paste text from MS Word 2011 into InDesign CS5.5 and have it retain the original formatting? Each time I try to copy and paste content from MS Word, even into a text box, all the bolding and italics are lost. I've tried to troubleshoot this on the forum but can't seem to find a relevant thread. Any help would be greatly appreciated, I've spend a fair amount of time trying to figure out this issue.
    Thanks.

    In the preferences you can choose to retain formatting when pasting from other applications. See screen shot.

  • Ecuaciones de word 2007 a indesign cs5

    hola, necesito ayuda. tengo un documento de word 2007 lleno de ecuaciones insertadas con el editor.
    las necesito llevar a indesign cs5, pero si el documento es .docx en indesgin queda el espacio en blanco donde van las ecuaciones, y si es .doc, las importa como png. muy en baja. me pueden ayudar como hacer?
    gracias!!

    Aunque es un trabajo laborioso una posibilidad es crear un pdf desde word,
    y luego abrir el pdf en illustrator y extraer cada ecuación. Si todo
    funciona bien, puede ocurrir que haya signo de ecuaciones que den
    problemas, tendrás las ecuaciones como eps, no es rápido pero la calidad es
    vectorial y se agradece. La otra opción es abrir el pdf con photoshop en
    este caso recortarás cada ecuación y tendrás jpg o tiff. Puede que sea más
    rápido que con illustrator pero la calidad no es igual.
    Antes de hacer cualquier cosa, copia la ecuación en word y pega en
    illustrator y mira si funciona, si es así te ahorras el paso por el pdf.
    También te puedes mirar este script
    http://www.mtscript.ru/
    cuesta dinero pero creo que si son tantas como dices te ahorrará un tiempo
    curioso.
    Aunque la página esté en ruso hay un manual en inglés y por lo que veo te
    podrá servir
    un saludo
    mateo
    2013/4/8 RICCIDISENIO2004 <[email protected]>
       Re: Ecuaciones de word 2007 a indesign cs5
    created by RICCIDISENIO2004<http://forums.adobe.com/people/RICCIDISENIO2004>in
    Foros de usuario a usuario - View the full discussion<http://forums.adobe.com/message/5217436#5217436

  • Script to find duplicate index and how can we tell if an index is REALLY a duplicate?

    Does any one have script to find duplicate index? and how can we tell if an index is REALLY a duplicate?
    Rahul

    One more written by Itzik Ben-Gan
    The first query finds exact matches. The indexes must have 
    the same key columns in the same order, and the same included columns but in any order. 
    These indexes are sure targets for elimination. The only caution would be to check for index hints. 
    -- exact duplicates
    with indexcols as
    select object_id as id, index_id as indid, name,
    (select case keyno when 0 then NULL else colid end as [data()]
    from sys.sysindexkeys as k
    where k.id = i.object_id
    and k.indid = i.index_id
    order by keyno, colid
    for xml path('')) as cols,
    (select case keyno when 0 then colid else NULL end as [data()]
    from sys.sysindexkeys as k
    where k.id = i.object_id
    and k.indid = i.index_id
    order by colid
    for xml path('')) as inc
    from sys.indexes as i
    select
    object_schema_name(c1.id) + '.' + object_name(c1.id) as 'table',
    c1.name as 'index',
    c2.name as 'exactduplicate'
    from indexcols as c1
    join indexcols as c2
    on c1.id = c2.id
    and c1.indid < c2.indid
    and c1.cols = c2.cols
    and c1.inc = c2.inc;
    The second variation of this query finds partial, or duplicate, indexes 
    that share leading key columns, e.g. Ix1(col1, col2, col3) and Ix2(col1, col2) 
    would be considered duplicate indexes. This query only examines key columns and does not consider included columns. 
    These types of indexes are probable dead indexes walking. 
    -- Overlapping indxes
    with indexcols as
    select object_id as id, index_id as indid, name,
    (select case keyno when 0 then NULL else colid end as [data()]
    from sys.sysindexkeys as k
    where k.id = i.object_id
    and k.indid = i.index_id
    order by keyno, colid
    for xml path('')) as cols
    from sys.indexes as i
    select
    object_schema_name(c1.id) + '.' + object_name(c1.id) as 'table',
    c1.name as 'index',
    c2.name as 'partialduplicate'
    from indexcols as c1
    join indexcols as c2
    on c1.id = c2.id
    and c1.indid < c2.indid
    and (c1.cols like c2.cols + '%' 
    or c2.cols like c1.cols + '%') ;
    Be careful when dropping a partial duplicate index if the two indexes differ greatly in width. 
    For example, if Ix1 is a very wide index with 12 columns, and Ix2 is a narrow two-column index 
    that shares the first two columns, you may want to leave Ix2 as a faster, tighter, narrower index.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

Maybe you are looking for

  • Itunes assigns track numbers automatically

    iTunes 11 - When I play a track, sometimes iTunes will automatically assign a track number to it, but not always. So what happens is it winds up putting an entire albumn out of order. In other ones, it will assign track #1 to track 1, then track 4 to

  • Unable to Start/Stop SBO Mailer and SBO Backup services

    Hi All, With reference to the thread of the following Link : SBO Backup and Messenging Service - Starting , We have a customer on SAP B1 8.8 PL 16 and we faced the same issue wherein after restarting the server, SBO Mailer and SBO Backup services sho

  • Error refreshing report from parameter panel

    I'm using Crystal Reports 2008 SP3 with .Net 4.0 in visual studio 2010 I'm using the following components CrystalDecisions.CrystalReports.Engine   12.0.2000.0 CrystalDecisions.Enterprise.Framework   12.0.1000.0 CrystalDecisions.Enterprise.InfoStore  

  • Cannot Upload all edited Images of the same Image from Organisor

    Can anyone tell me how I can upload edited verions of the same image using the Share Option to create an Online Album in Adobe Showcase?  Only the most recent image will upload.  If you have any ideas to adress this problem, I would appreciate your c

  • LR5.3 Export issue with Sequence Renumbering

    I just discovered an issue with the LR5.3 Export module on my Windows 7 system when exporting JPEG image files with 'Sequence' File renaming and 'Original' File Settings to a subfolder. When exporting approximately 100 JPEG image files LR shows a fil