Leading Zero is being removed in IIS6

Posted on 2011-10-19
Last Modified: 2012-05-12

I got an ASP page (Classic ASP) that was designed 6 years ago to import data to SQL 2000. the page was running on Windows 2000 IIS 5. I want to upgrade the server to Windows 2003 R2 and move the page there but I came across an issue when I was testing it.

It seems that IIS 6 is removing the leading zero from the data.

I created a file called test.csv in notepad:


I used the application on IIS 5 and data got imported to SQL just fine. Zero was not removed.

I then use the same file in IIS 6 and leading zero in 01233 is being remove when data are being imported.

Data are getting import to the same SQL server.

Is this an IIS setting or do I need to get a programmer to fix the application?

if IIS setting how can I fix this?


Question by:ezzadin
    LVL 82

    Accepted Solution

    I'm probably that it is not an IIS setting.  But the ASP interpreter for IIS6 may not be exactly the same as for IIS5.1.  If '01233' can be viewed as a number at any point, then the leading zero gets removed because it has no value as a number.  This can happen in ASP or .NET or PHP or especially when you import it into Excel.  When it is my choice, I always start fields like that with a letter which will 'automatically' make it a text field.  Numbers used as 'names' with leading zeros are often a problem.

    We might be able to give more specific help if you post the ASP code.

    Author Comment

    thanks. there are so many processes and ASP pages in there and I'm not even sure which is the correct one.

    I will try to contact the developer who designed it and see.

    I actually tried the same thing using txt file and it worked for both IIS 5 and IIS 6



    Assisted Solution

    this wasn't an iss issue as you mentioned Dave. The following registry modification fixed the problem:


    MaxScanRows will define how many rows to scan to decide the column type and once you set it to zero it will ignore that.


    Author Closing Comment

    Registry change fixed the issue
    LVL 82

    Expert Comment

    by:Dave Baldwin
    Thanks for the points.  That's an interesting registry issue.  "ImportMixedTypes"="Majoritytype" and "MaxScanRows"=25 on my computer.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
    Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now