Query not returning all records in the table with not "where" condition

  • HI,

    Today I experienced a weird problem I never faced before.

    There is a table which contains 1405 rows, but when I execute "Select * from" only 1250 rows are displayed.

    This table contains column in which XML is stored in a varchar format.

    If I change this column from varchar to nvarchar all rows are getting displayed.

    Why is sqlserver behaving like this??

    All limits in query options are set to maximum.

    I am using SqlServer 2008 R2Express

    Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (Intel X86) Apr 2 2010 15:53:02 Copyright (c) Microsoft Corporation Enterprise Edition on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (WOW64)

    Thanks,

  • Please provide step by step description of what you are doing to get different number of rows from the same table, starting CREATE TABLE.

  • Hi Serg,

    This scenario occurred as part of my routine work, where I tried to fetch data from the table and noticed that complete data is not fetched and there onwards tried to solve the issue.

    The data is inserted into this table through application so I cannot provide complete details.

    As far as I am involved with the issue is from the step where I tried to fetch the data.

    I can provide you with any log data or machine or instance related data.

    Thanks

  • What number is resturned when you execute:

    SELECT COUNT(*) FROM {your_table}

    What number is returned when you execute:

    SELECT COUNT({your_xml_column}) FROM {your_table}

    What number is returned when you execute:

    SELECT COUNT(CAST({your_xml_column} as NVARCHAR(4000))) FROM {your_table}

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • Hardly we can do much without at least a table definition (CREATE TABLE) and a sample row which is not / is selected before / after ALTER TABLE.

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

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