Why does the Excel source think my query has parameters?

Part of my current project involves converting an Excel spreadsheet having a number of tabs into an equal number of pipe-delimited flat files using an SSIS package. I've got one data flow task that opens up the excel file and selects the names of all the
tabs into and object variable. A second data flow task inside a for each loop attempts to read the first 32 columns from each tab. The excel source in the second data flow task is set up to use a sql command from a variable, and the variable is an expression
that substitutes the tab name into an otherwise-constant sql statement like this:
SELECT F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22,
F23, F24, F25, F26, F27, F28, F29, F30, F31, F32 FROM [Securities Portfolio$]
The "First row has column names" box in the excel connection manager is not marked.
Here's the thing: this works for most of the tabs. The one above works. However, three of them are causing the following error:
The SQL command requires 2 parameters, but the parameter mapping only has 0 parameters.
I've modified the package to print all of the SQL statements used in the log file. The only difference is in the tab name. None have any question marks, which is what I thought SSIS used to mark parameters. I can't figure out what causes this, or even how
thw failing SQL queries are different than the ones that work:
SELECT F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22,
F23, F24, F25, F26, F27, F28, F29, F30, F31, F32 FROM [Capital - Part1$]SELECT F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22,
F23, F24, F25, F26, F27, F28, F29, F30, F31, F32 FROM [Capital - Part2$]SELECT F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22,
F23, F24, F25, F26, F27, F28, F29, F30, F31, F32 FROM [Securities Sources$]
Any help would be appreciated.

OK, I figured it out, and will write it here in case someone else has a similar issue, because I spent several hours on Google trying to figure out what was going on.
It turns out that not all of the worksheets actually HAVE 32 columns. It did not occur to me at first that this could be an issue, because when you open an Excel file in Excel, there are always more columns if you just scroll over more. However, the way
Microsoft Jet reads Excel files, each worksheet has a fixed number of columns.
The worksheets that were causing the issue were the ones that have fewer than 32 columns. If there are only 30 columns and I try to select F32, Microsoft Jet assumes that F32 is supposed to be the name of a parameter. As far as I can tell, SSIS 2008 does
not allow you to set up parameter values for use with Jet, but Jet will nevertheless parse your query and determine that there are parameters needed if it can't find some of the column names.
To get around this, I changed the step that gets the worksheet names to also return the number of columns in each worksheet, and then changed the query to return NULL for any columns that don't exist. So, for a worksheet having only 30 columns, I now run
this:
SELECT F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22,
F23, F24, F25, F26, F27, F28, F29, F30, NULL AS F31, NULL AS F32 FROM [Capital - Part1$]
And that fixes it.

Similar Messages

  • Why does the Input Source keep changing?

    I have two languages in my list of Input Sources - Maori and Australian.  I normally have it set on Maori, but in the last week it's been defaulting back to Australian.  Anyone have any ideas how to resolve the issue??

    Go to the User's Library folder. This folder is hidden by default. To unhide: Select the Finder in the Dock. Under Go in the Menu bar > hold down the Option key and you’ll see the Library.
    Scroll to Preferences
    Drag the com.apple.finder.plist and the com.apple.systempreferences.plist to the trash.
    Log Out under the Apple in the Menu bar
    Log in
    Reset your preferences.
    If it does not stick....
    Boot into the Recovery Drive by holding down Command R when restarting.
    Run Repair Drive and Repair Permissions using Disk Utility in Recovery.
    Restart
    Download and run the combo updater to refresh your OS X files.
    OS X Mavericks 10.9.4 Update (Combo)
    http://support.apple.com/kb/DL1755
    Post Date: Jun 30, 2014
    File Size: 958.2 MB

  • Why does the mail app think my email username and or password is wrong, when they are correct?

    I used to be able to check my AOL email through the mail app on my ipod touch. Recently it has been telling me that my username and/or password for my AOL email is wrong. I checked my username and password by logging in to my email on my computer. I tried deleteing and readding the account. Restoring then readding. I am able to use my gmail accounts on my ipod touch.

    Hi,
    Is your AOL account an AOL Kids account?  I have seen problems with AOL Kids accounts before in Apple Discussions.  Try a forum search and see if anything useful comes up. 
    Hope this helps! 
    ---likeabird---

  • Why does the Firefox website think I have version 3.6.10 when I really have version 7.01?

    I've updated to 7.0.1. It looks like Firefox 7.0.1. When I go up to "(about Firefox) it says I have 7.0.1. However when I try to use any some of the add-ons. It says I can't use them because I have Firefox 3.6.10. WHAT THE HECK??? Also, when I go into certain sites like iCloud for instance, It says I have an old version of Firefox and need to update to Firefox 7.0.1. BUT I HAVE AND I AM EVEN USING PERSONAS that are for 7.0.1. HELP!!!!!

    Websites, including this one, check your user agent string to see what browser you're using. Yours is currently:
    * ''Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 FBSMTWB''
    My guess is whatever addon you have (or once had) installed that felt the need to add the FBSMTWB junk to the end overrode your real UA to do so and broke things for you. You'll want to reset things to let Firefox set it properly again. Follow the steps here to do so:
    * [[Websites or add-ons incorrectly report incompatible browser]]

  • Why does the lion logo have spots on his nose?  I don't think lions EVER have spots like this.  If photoshopped, why?

    why does the lion desktop pic (a beautiful lion for sure) have spots on his nose....they never do!  This just ruins a beautiful animal face...why not just leave it alone? Looks like a bad photoshop job...done by someone who has never seen a real lion.....but why?

    I though you were joking.
    Anyway, do a quick search of "Lion" in google images
    I see spots.
    Here's the desktop photo:
    Interesting though, it looks like the spots were removed in the photo used in the App store:

  • Why does the option to watch a movie even appear if it then will not play because not downloaded? Worse, then only 23hrs left to watch!! Paying for what is not delivered!!

    ITUNES:  Why does the option to "watch movie now" appear & when chosen movie will not play because still downloading. WHY SHOULD THE OPTION APPEAR IF MOVIE CAN"T BE PLAYED. Then when movie is viewable, only 23hrs to watch! PAYING FOR MOVIES WITHOUT OPPORTUNITY TO VIEW does not make happy consumer. Emailed Itunes over and over about problem and stilll paying for services unrendered.

    When iTunes/iPod sync process failed due to timeout, the iPod, has only the initilaised  filesytem structure at the start of the Sync.
    The timeout failure could be due to
    Bad hardisk - do the iPod disk diagnostic, refer to this excellent post by tt2
    Slow USB port or resource - Dont use any USB hub, disconnect all other USB devices while syncing
    Timeout due to Antivirus or other plugins - disconnect from Internet and stop the Antivirus or monitoribng software if you are syncing.
    Preferably stop doing other things while syncing this ancient device, which the latest iTunes designer, think will soon be extinct.
    Have a nice day!

  • Why does the Java method ServletContext.getResourceAsStream return null with a know good path to an xsl file?

    iPLANET ISSUE
    Why does the Java method ServletContext.getResourceAsStream return null with a know good path to an xsl file?
    CODE
    ServletContext context = mpiCfg.getServletConfig().getServletContext();
    // Debugging
    out.print(context.getServerInfo());     // Get server info
    out.print(“getRealPath = ” + context.getRealPath("WEB-INF/xsl/RedirectToAcs.xsl"));
    String strXslName = "RedirectToAcs.xsl";
    InputStream is = context.getResourceAsStream("WEB-INF/xsl/"+ strXslName);
    TRACE FROM THE LOG
    [26/Jul/2002:08:23:15] info ( 2868): [0][][ClearCommerceCcpaMpi][]getServerInfo() = iPlanet-WebServer-Enterprise/6.0, getRealPath() = C:\iPlanet\Servers\web-apps\ccpa\WEB-INF\xsl\RedirectToAcs.xsl
    [26/Jul/2002:08:23:15] info ( 2868): [0][][ClearCommerceCcpaMpi][]strXslName = RedirectToAcs.xsl, is = null
    [26/Jul/2002:08:23:15] info ( 2868): [1][][ClearCommerceCcpaMpi][16]ResourceAsStream is null
    [26/Jul/2002:08:23:15] info ( 2868): [1][][ClearCommerceCcpaMpi][30]Problem reading XSL file.
    DIRECTORY DUMP
    C:\iPlanet\Servers\web-apps\ccpa\WEB-INF\xsl>dir
    Volume in drive C has no label.
    Volume Serial Number is 9457-EBF4
    Directory of C:\iPlanet\Servers\web-apps\ccpa\WEB-INF\xsl
    07/22/2002 05:54p <DIR> .
    07/22/2002 05:54p <DIR> ..
    07/22/2002 05:54p 3,086 RedirectToAcs.xsl
    07/22/2002 05:54p 3,088 Response.xsl
    2 File(s) 6,174 bytes
    2 Dir(s) 1,797,405,696 bytes free

    I think there's supposed to be a forward slash before WEB-INF.
    InputStream is = context.getResourceAsStream("/WEB-INF/xsl/"+ strXslName);

  • Why does the tab bar on my iPad 2 disappear when I swipe down? How can I lock it in place?

    Why does the tab bar on my iPad 2 using IO8 disappear when I swip down? Its annoying. I have to tap the top of the screen to view my open tabs.
    why did Apple switch the position of the bookmarks icon and the favorites icon. Now I tap the wrong one.

    There isn't a setting to stop the tab bar automatically hiding (or I haven't found one), and as to why the icons were moved I don't think that Apple have said. If you want to leave feedback for Apple then you can do so here : http://www.apple.com/feedback/ipad.html

  • Why does the document window in illustrator cs6 move to the far left when I reopen the file?

    why does the document window in illustrator cs6 move to the far left when I reopen the file?

    Hi John,
    thanks for the fast response.  cs5 remembered the window position.  I like having the window in the middle as I have a 27" monitor.  I just upgraded to cs6 yesterday and I'm sure it was remembering the window document position.  I think.  If i find out how to fix this, I'll post it here.
    And while I'm on the subject of cs6, why the f*** did adobe combine the stroke and swatches pallettes?  Now I forever have to click stroke and swatch tabs all day.  And I love the army and navy file icons of photoshop and illustrator.  I won't comment on Acrobat X.  ; (

  • Why does the error console continuosly keep filling up ? in yellow, pink & blue messages ??

    Ok, first I am using an older, slower Mac G4 400 Mhz, PCI, "YIKES" model machine. ..... The problem is that after browsing mail for 1/2 hr., Fire Fox slows down a lot. Most likely related to my machine speed. I understand that and this machine is a backup computer. I can cure the speed problem by closing FF, and relaunching it, and speed is fine for another 1/2 hr. or more. Then repeat the close and restart for speed reset as needed. This seems to clear a backlog of info. slowing down the CPU.
    THE REAL QUESTION IS; Why does the ERROR CONSOLE keep filling up with messages in pink, yellow and blue, warnings, errors, and (blue) website not supported messages ??.
    The message copy & pasted in the trouble shooting info. box is the first one to show up immediately after "clearing error console" window (5 seconds later), it will be filling up as I type now. and I don't know squat about coding or deep workings of computers, I am to old to start learning now, but it just seems to me that the "ERROR console" should not be filling up with every mouse click I make while browsing mail & websites I use everyday, that are working just fine as far as I can tell.
    I have watched the error console fill up as I brows, usually 1 mouse click can produce 4 to 8 lines in the error console, clearing it out doesn't seem to affect the speed problem at all, so is unrelated to speed (??) I think.
    But the Question is ??? why does the ERROR CONSOLE keep filling up with all these messages when FF seems to be working fine ????????
    There are now 15 (PINK) separate lines of the same message in the console window, just while typing this out. 0
    Reply to ;<[email protected]> ..... I am really curious about this and await an answer. Thank You. wayne

    Hello, took me awhile to find this out, but...
    Get the combo update for Intel-based Macs...
    http://www.apple.com/support/downloads/macosx10411comboupdateintel.html
    Safe Boot, (holding Shift key down at bootup), & use Disk Utility from there to Repair Permissions, reapply the Combo Update.
    Repair Permissions afterwords, reboot.

  • Why does the iPod 4g freeze every 5 min ?

    Why does the iPod 4g freeze every 5 min ? This is really annoying. I will choose Samsung next time if apple continue like this. Samsung is much better. I'm on iOS 6.1.5 (last update). Does apple do a bad a updat to force people de buy a new idevice. Personally I think this. It's not really good from apple

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                                                                
    - Restore to factory settings/new iOS device.             
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
      Apple Retail Store - Genius Bar

  • Why Does The AUR Site Log Me Out So Quickly?

    Why does the AUR website log users out so quickly?  It is highly annoying.

    Paul and Simo, I think. Or maybe its Simo and Paul. AUR bug tracker is a good thing for contacting them...
    check this bug:
    http://bugs.archlinux.org/index.php?id=3059&do=details
    Dusty

  • Why does the Apple mouse drain so quickly?

    I'm not sure if this question is in the right place. I bought a iMac back in January and I've been changing the batteries like every few weeks. My question is why does the mouse drain so quickly?
    The batteries in the keyboard have been in there since I got the computer. I think I should buy a wired mouse and just plug it into the back of the iMac. I'm getting sick and tired of having to change the batteries so often.

    Hello:
    Battery drain is a function of how much the device is used (no surprise to you).  I find that my mouse batteries last less - probably because I type so slowly, I use the mouse for anything I can.
    Let me give you a suggestion based on my own experience.
    I use rechargeable batteries and a 15 minute battery charger.  I currently have a drawer full of Energizer 2450 mAh rechargeable batteries and an Energizer 15 minute charger (works for AA and AAA batteries).  Rechargeables last less time than Lithium batteries - I think the reason is different voltages (1.2 vs 1.5).  I obtained all of the batteries and the charger - new - on eBay at a very reasonable price.
    By using rechargeables, you are never without a fresh battery more than 15 minutes, and you are environmentally friendly to boot! 
    Barry

  • HT1725 Why does the download start again for the start. I only hve access to a 3G wifi connection so one tv episode had cost me about $10 I'm download costs because of several interruptions.

    Why does the download start again for the start. I only hve access to a 3G wifi connection so one tv episode had cost me about $10 I'm download costs because of several interruptions. Is there a way to change that?

    Among the alternatives not mentioned... Using a TiVo DVR, rather than the X1; a Roamio Plus or Pro would solve both the concern over the quality of the DVR, as well as providing the MoCA bridge capability the poster so desperately wanted the X1 DVR to provide. (Although the TiVo's support only MoCA 1.1.) Just get a third-party MoCA adapter for the distant location. Why the hang-up on having a device provided by Comcast? This seems especially ironic given the opinions expressed regarding payments over time to Comcast. If a MoCA 2.0 bridge was the requirement, they don't exist outside providers. So couldn't the poster have simply requested a replacement XB3 from the local office and configured it down to only providing MoCA bridging -- and perhaps as a wireless access point? Comcast would bill him the monthly rate for the extra device, but such is the state of MoCA 2.0. Much of the OP sounds like frustration over devices providing capabilities the poster *thinks* they should have.

  • Why does the file Name for file attached with Annotations "Attach File" (paperclip) become Unknown when Comments are Published?

    Our company recently purchased Adobe Acrobat Pro XI for the purpose of using it for shared electronic reviews.  We are using Send for Shared Review created in Adobe Acrobat Pro XI, and all the Comment tools work as expectedexcept the paperclip in Annotations.
    When a Word or Excel or Image(png,jpeg) file is attached using the Annotations paperclip, the initiator can initially see and open it. But after Publish Comments is selected and the review file is closed, the file "Name" changes to "Unknown" (although the Description has the correct file name and extension).  The Modified information is Unknown, as is the Size and Compressed Size.
    When the review file is then re-opened, even the initiator cannot open the file, although:
    The file location is marked with the paperclip within the document.
    The file name is shown in the Comments List with the initiator's name.
    In the Attachments list (the paperclip beneath the Thumbnails and Bookmarks) the Name appears as Unknown, Description shows the file name, Modified is Unknown, Size is Unknown, and Compressed Size is Unknown.
    The file Name cannot be edited, although the file Description can be.
    We have followed the procedure described in the tutorials but cannot figure out how to troubleshoot this situation.  Since this feature was the reason for the purchase of Adobe Acrobat Pro IX, we would any help. Please don't leave out any basics since we are all new users.
    We have several people with Adobe Acrobat Pro XI and the rest have Adobe Reader XI and it is a Windows platform.  Can someone please give us some advice how to get this feature to work as described?

    FYI Rave,
    There are some other forum entries with this exact same issue...:
    Cannot Open Attachments in PDF
    Why does the file Name for file attached with Annotations "Attach File" (paperclip) become Unknown when Comments are Published?
    Can someone help us get the COMMENTS ATTACHMENT TOOL to work as described in Acrobat Pro XI?

Maybe you are looking for