Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

View showing different results in preview vs the view

 
   Database Help (Home) -> MSEQ RSS
Next:  VBA - GET / SET ??  
Author Message
Achase

External


Since: Oct 28, 2008
Posts: 2



(Msg. 1) Posted: Tue Oct 28, 2008 7:33 am
Post subject: View showing different results in preview vs the view
Archived from groups: microsoft>public>sqlserver>mseq (more info?)

I'm not sure what is happening here. I have a view setup to order by 1
column then a 2nd which happens to be the key rec as it's the only field
where every cell is unique. In the Preview it orders the data properly by
the column I want then by the key rec. However the main view is ordered by
the Key rec still and no different than my table. I've checked and based on
the preview and criteria it looks good. I'm using SQL 2005 Dev version at
the moment to try and get some testing done before taking the data live.

 >> Stay informed about: View showing different results in preview vs the view 
Back to top
Login to vote
Russell Fields

External


Since: Jan 10, 2008
Posts: 608



(Msg. 2) Posted: Tue Oct 28, 2008 1:13 pm
Post subject: Re: View showing different results in preview vs the view [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Achase,

I am afraid that what you are seeing and what is happening are only
coincidentally matching your expectations. The BOL say that an ORDER BY in
a view will not guarantee an ordered result. See:

http://msdn.microsoft.com/en-us/library/ms188385.aspx
"When ORDER BY is used in the definition of a view, inline function, derived
table, or subquery, the clause is used only to determine the rows returned
by the TOP clause. The ORDER BY clause does not guarantee ordered results
when these constructs are queried, unless ORDER BY is also specified in the
query itself."

RLF

"Achase" wrote in message

> I'm not sure what is happening here. I have a view setup to order by 1
> column then a 2nd which happens to be the key rec as it's the only field
> where every cell is unique. In the Preview it orders the data properly by
> the column I want then by the key rec. However the main view is ordered
> by
> the Key rec still and no different than my table. I've checked and based
> on
> the preview and criteria it looks good. I'm using SQL 2005 Dev version at
> the moment to try and get some testing done before taking the data live.

 >> Stay informed about: View showing different results in preview vs the view 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
index on a view - Hello, I have a table (TAB) and A View with alias (VIEW) Table cod varchar 3 descr carchar 60 my view cod alias COd1 descr alias DES Now i need a index on view with key COD1 I can't create it. Can..

Creating an alias - I have an alias that can get very long because it maintains a information of where it came from. Is there a way to alias an alias? My first thought was: Declare @T1 varchar(128) Set T1 = 'MyAlias' .... Inner Join Table1 as @T1 This of course does no...

Formatting numeric fields in select-clause - This is propably a very simple question, but I can“t seem to find the answer to it in the documentation. I want to format a numeric field so the result is right justified and zero-filled. ex select 1 will give the result 01 How do I manage this..

Simple Query problem - Sample table as follows Order ID Stock Code Status --------- ------- ------- 203 STK1 3 203 STK2 2 203 STK4 3 204 STK1 3 204 STK5 3 205 ..

query assistance -return most recent date - I have a table that has two fields, pkg_num, which is a number, and del_date_time, which is a date-time. The table can contain duplicate pkg_num values, as long as the del_date_time values are different for any given number. I need a query that will...
   Database Help (Home) -> MSEQ All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]