Data storage and retrieval

  • I am having a problem with a column that I have imported from excel.  The field is a master format code, that contains two digits, space, two digits, space, two digits i.e. 03 30 15.  I am storing this field as a nvarchar.  The problem is that my code that reads this column only returns some of the rows, for example I want to find all rows with a master format id that equals 03 00 00, it returns some but not all.  Also, when I do an insert into a new table and use the master format number and then to a select based on the master format in the new table, it cannot find it.  I believe this issue is due to the spaces and something within SQL 2005 or even my .NET app that wants to make it an int.  Does anyone have any ideas or suggestions (or any further clarification).  Thanks any/all help.

  • This was removed by the editor as SPAM

  • Force explicit type... delimit your string with quotes.  don't allow it to be converted to integer.

    Thank-you,
    David Russell
    Any Cloud, Any Database, Oracle since 1982

  • Hello lucas..

    It's unclear to me whether the data made it into SQL Server correctly; that ambiguity would certainly color my response here.

    If you run a select statement on your SQL table, do you see the values you expect?


    Take care..

    - Ward Pond
    blogs.technet.com/wardpond

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply