3 ms·
SQL Server and the 'feature' was still present in version 2003, not sure about version after that.
by nathanstitt 13y ago
SQL Server and the 'feature' was still present in version 2003, not sure about version after that.
- codeulike 13y agoSQL Server behaviour is: If you have a "select *" view and then add more columns to underlying table, columns will not show up in view until view if refreshed Thats not too bad, and it does not get the column names mixed up.
- sciolistse 13y agoThat's the way it works now. In earlier versions any added columns would still be retrieved, shifting all the other column values to the right.. So all the data would wind up having the wrong column names.
- codeulike 13y agoI've been using MS Sql from version 7, through 2000, 2005, 2008 etc, and I never saw that bug.
- einhverfr 13y agoThat's also the way it works in PostgreSQL. I think the view is actually compiled into a parse tree with named columns, and the view given a defined type iirc. (Select * from ... in PostgreSQL is actually really usefun in anything object-relational because you get objects of a named type back btw.)
- PommeDeTerre 13y agoThere was no SQL Server 2003. Do you mean 2005?
- nathanstitt 13y agoIndeed I did - thanks. I just remembered it was the version before 2008, as I left the company in the middle of the upgrade to that one. The columns being renamed on views bit us big time. We had a large ERP package that we'd built numerous custom views on top of. Whenever we applied an update to the ERP package, it'd add columns and all our views would be borked.