Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase «««45678

VIEWS 4 Expand / Collapse
Posted Thursday, January 10, 2013 5:15 AM

SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, August 4, 2014 5:38 AM
Points: 945, Visits: 558
Hugo Kornelis (3/27/2012)

What exactly are you confused about? This question is not at odds with the "unexpected results" quote in Books Online, as this error is just one of the possible unexpected results you can get; you only get this when the number of columns has been reduced. Other weird stuff is possible as well - see for instance this demo, that removes the "first" column of the table, then adds a new one.

Finally, note that just adding columns does not affect the results from the view; if you comment out the alter table drop column in the code above, the view will keep returning correct results. But dropping the table and recreating it with the columns in a different order (or reordering the columns through the SSMS table designer - which does the exact same thing under the covers) will have similar effects as the code above.

Thanks Hugo..

Desire to learn new things..
Post #1405356
Posted Wednesday, June 11, 2014 8:05 AM


Group: General Forum Members
Last Login: Thursday, September 11, 2014 4:02 PM
Points: 2,728, Visits: 224
It's more complicated than I thought.
Post #1579635
« Prev Topic | Next Topic »

Add to briefcase «««45678

Permissions Expand / Collapse