|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 4:24 AM
Points: 1,158,
Visits: 642
|
|
Steve - 0 points to you for creating a view using 'select *'...
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 9:48 AM
Points: 5,235,
Visits: 7,037
|
|
Good question, Steve!
Here is a link to the most recent version of the relevant Books Online article: http://msdn.microsoft.com/en-us/library/ms187821.aspx. It's the same aas the one in the explantion, but without the explicit version number added. (Why do people so often use links to older versions when the question is not about that older version? Why????)
The true danger of using SELECT * in a view becomes apparent if, after adding that new column, the original column is then dropped. The view will still return data, still use the name of the old (no longer existing) column, but return data from the new column.
Hugo Kornelis, SQL Server MVP Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Today @ 9:13 AM
Points: 2,475,
Visits: 2,134
|
|
paul s-306273 (2/7/2013)
Steve - 0 points to you for creating a view using 'select *'...  +1 - Apart from that - good question
------------------------------- Posting Data Etiquette - Jeff Moden Smart way to ask a question
There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan I would never join a club that would allow me as a member - Groucho Marx
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Today @ 10:40 AM
Points: 445,
Visits: 1,196
|
|
Awesome QtoD, thank you Steve.
(was thinking if the 4th option will come true in future versions, would be cool, and then thought again.. setting auto to everything is not a acceptable way to go, but it would be a nice feature and a lot to consider before really using it
Using "schemabinding" and "select *" ... I do not feel comfortable using it.. i create VIEW with the specifying column names, and if needed, then alter the view to suit the new needs and modify the code to the new adjustments. Earlier i had views with select * in one of the web projects and then later I changed them to the column specifics.. and by doing that whenever it is needed I kind of gained control over the objects by knowing which object needs modification and which doesn't and i was knowing each and every VIEW object which are the tables it refers.)
ww; Raghu -- There are only 10 types of people in the world, those who understand binary, and those who don't.
Note: (as of now) only.. 1 and 4 applies (i am on my way...)
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 9:48 AM
Points: 5,235,
Visits: 7,037
|
|
paul s-306273 (2/7/2013)
Steve - 0 points to you for creating a view using 'select *'...  So how should Steve have made a QotD about the dangers of select * in a view without using select * ???
Hugo Kornelis, SQL Server MVP Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Yesterday @ 5:12 AM
Points: 210,
Visits: 208
|
|
Hugo Kornelis (2/7/2013)
paul s-306273 (2/7/2013)
Steve - 0 points to you for creating a view using 'select *'...  So how should Steve have made a QotD about the dangers of select * in a view without using select * ???
+1 - but I note that if a warning about using "SELECT *..." had been added to the explanation, this would have been even more helpful.
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Today @ 10:40 AM
Points: 445,
Visits: 1,196
|
|
alex.d.garland (2/7/2013)
Hugo Kornelis (2/7/2013)
paul s-306273 (2/7/2013)
Steve - 0 points to you for creating a view using 'select *'...  So how should Steve have made a QotD about the dangers of select * in a view without using select * ??? +1 - but I note that if a warning about using "SELECT *..." had been added to the explanation, this would have been even more helpful.
... it is like... "never say never...."
ww; Raghu -- There are only 10 types of people in the world, those who understand binary, and those who don't.
Note: (as of now) only.. 1 and 4 applies (i am on my way...)
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Yesterday @ 3:48 AM
Points: 3,125,
Visits: 4,311
|
|
Good question, Steve, thanks
____________________________________________ Space, the final frontier? not any more... All limits henceforth are self-imposed. “libera tute vulgaris ex”
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Friday, April 19, 2013 10:27 AM
Points: 690,
Visits: 1,100
|
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Today @ 11:47 AM
Points: 3,226,
Visits: 64,172
|
|
|
|
|