Groups | Blog | Home
all groups > sql server new users > july 2006 >

sql server new users : What causes a query to return no rows?


Keith
7/3/2006 4:03:54 PM
In a database with two tables, both containing data, SELECT queries against
one table returns data rows as expected, while queries against other table
return only column headers and no data rows? The first table was created
manually using SQL Server Management Studio, the second table was created by
an ASP.NET utility.

Thanks,

Keith

Arnie Rowland
7/3/2006 4:41:44 PM
What causes no rows of data to be returned is that there are NO ROWS of data
that satisfy the query.

Check the query WHERE criteria. Does it reference something that is
different in the two tables.

Otherwise, in order for us to better assist you, please post the entire
queries and the DDL for the tables.

--
Arnie Rowland*
"To be successful, your heart must accompany your knowledge."



[quoted text, click to view]

Andrew J. Kelly
7/3/2006 7:51:18 PM
Also make sure the datatypes of the column in the WHERE clause and the value
you are equating it to are the same.

--
Andrew J. Kelly SQL MVP

[quoted text, click to view]

Andrew Watt [MVP]
7/4/2006 4:55:31 PM
On Mon, 3 Jul 2006 16:03:54 -0700, "Keith" <kbrickey@dslextreme.com>
[quoted text, click to view]

Hi Keith,

There seem to be occasional problems like this with some tables
created from ASP.NET. I don't know enough about the individual
occurrences to say whether it is a bug or if the tables weren't
created correctly.

One thing to check from SQL Server Management Studio is whether you
can access data in the ASP.NET-created table from SSMS. Right click on
the table and select Open Table.

AddThis Social Bookmark Button