nvarchar field problem

  • I have a table and one of the fields is defined as nvarchar(255).  In Query Analyzer, if I do a select * from the table I see values is most rows of data. If I issue select field1, field2 (where field2 is the field in question), all returned rows have field2 as being blank. What am I missing?


    Terry

  • By changing the column list in SELECT, you potentially change the order in which rows are returned.

    It may be you are just seeing a different part of the resultset.

    Only way to be certain what's in that column across the entire table:

    SELECT Count(*)

    FROM YourTable

    WHERE field2 Is NULL Or field2 = ''

  • I'm returning the same number of rows, the same 1st three fields, but the 4th one comes through with a different value ('') as opposed to 1, 0 or ''.


    Terry

  • Hi,

    Do select field1, len(field2) to make sure what is the lenght of the records. What is the need to use nvarchar(255) for thevalues as 0,1 or ''

    Regards,Yelena Varsha

  • It's actually Backup Exec 9.1 which sits on top of SQL server. Reporting, for my needs, is limited so I'm trying to query the underlying tables to extract data that is pertinent to me.


    Terry

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

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