jbenson001
Programmer
Hi all,
I have a view defined as(SQL Server 2005):
When I save and run this code in SQL Server Management Studio, the code runs fine and orders the rows by name as expected. However, I noticed when I select from the view in my VB app, the rows displayed in the order of the ID column, not by name. To check, I opened a query window and did a
It displays in ID order, not name order. I thought maybe the name of the "Name" column, but changed it and still the problem. It only displays corretly in the view designer window. The only way to make it work is to do:
Can anyone explain this behavior? Why is my Order By being ignored?
Thanks everyone...
Jim
I have a view defined as(SQL Server 2005):
Code:
SELECT TOP (100) PERCENT IsActiveFlg AS Active, Name, Address1 AS [Address 1], Address2 AS [Address 2], City, State, Zip, HomePhone AS [Home Phone], BusinessPhone AS [Business Phone], CellPhone AS [Cell Phone], CustomerId
FROM dbo.Customer
ORDER BY Name
When I save and run this code in SQL Server Management Studio, the code runs fine and orders the rows by name as expected. However, I noticed when I select from the view in my VB app, the rows displayed in the order of the ID column, not by name. To check, I opened a query window and did a
Code:
Select * from CustomerView
Code:
Select * from CustomerView Order By Name
Can anyone explain this behavior? Why is my Order By being ignored?
Thanks everyone...
Jim