February 7, 2013 at 3:14 am
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.
February 7, 2013 at 3:17 am
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
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
February 7, 2013 at 4:28 am
This was removed by the editor as SPAM
February 7, 2013 at 5:56 am
Good question. Thanks.
February 7, 2013 at 7:02 am
Good question, I learned something.
Generally I don't ever write views with SELECT * in them.
but even if I did... If I had to refresh the view, I'd typically just alter the view and leave the code as is... that works too, or did... I haven't written a view with SELECT * in it since before SQL 2005
February 7, 2013 at 7:26 am
Good question!
I wondered about an ALTER VIEW statement being there as well since altering the view inherently refreshes it, but then recalled that *'s aren't allowed in schema-bound objects. Nice!
February 7, 2013 at 7:52 am
Nice 1 Steve. However, I don't recommend anyone to use SELECT * FROM in view.
February 7, 2013 at 8:58 am
Thanks Steve
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
February 7, 2013 at 10:00 am
Good question, thanks Steve. Definitely highlights an important point when using views.
February 7, 2013 at 10:03 am
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 * ???
Good question, great discussion, and learned from both. Hugo has a point you cannot illustrate the problems and pitfalls without illustrating the problem or pitfall. Our teachers use to say "Don't ever say lookin, say looking! " And then some smarty would say "But you just said lookin, why can't we?":-)
Not all gray hairs are Dinosaurs!
February 7, 2013 at 10:22 am
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.
Fair point and added.
February 7, 2013 at 10:43 am
Nice question, Steve. I knew the answer right away from previous posts in the forums.
By the way, I remember RBarry Young posted some code that he used to run overnight in order to rebuild all views. The code looked interesting and it made sure when a table was altered its views would be accurate next day. However, I'm unable to find the post. I will do some further search and post the link to it when I find it.
Saludos,
February 7, 2013 at 10:51 am
February 7, 2013 at 1:00 pm
EL Jerry (2/7/2013)
Got it. Here it is:http://www.sqlservercentral.com/Forums/FindPost1349883.aspx
Saludos,
That is a version with some problems (misplaced '[' and ']', misplaced 'with scheamabinding' clause, using [] on identifiers in drop but not on create) which are easily fixed. I don't know whether Barry posted a corrected version later.
It was an amazing thread - I pity the OP having to put up with a lead who bases his decisions on a vivid imagination with a strong inclination towards fiction.
Tom
February 7, 2013 at 1:25 pm
L' Eomot InversΓ© (2/7/2013)
EL Jerry (2/7/2013)
Got it. Here it is:http://www.sqlservercentral.com/Forums/FindPost1349883.aspx
Saludos,
Wow, that is a humorous thread! I am glad I don't work with that lead. Talk about misdirection...
Viewing 15 posts - 16 through 30 (of 33 total)
You must be logged in to reply to this topic. Login to reply