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 «««1234»»

Updating Views Expand / Collapse
Author
Message
Posted Thursday, February 7, 2013 7:26 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 9:09 AM
Points: 1,425, Visits: 2,449
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!
Post #1417064
Posted Thursday, February 7, 2013 7:52 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Monday, April 21, 2014 10:49 AM
Points: 662, Visits: 69
Nice 1 Steve. However, I don't recommend anyone to use SELECT * FROM in view.
Post #1417083
Posted Thursday, February 7, 2013 8:58 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 6:12 PM
Points: 18,082, Visits: 16,117
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
Post #1417141
Posted Thursday, February 7, 2013 10:00 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 9:42 AM
Points: 3,429, Visits: 2,039
Good question, thanks Steve. Definitely highlights an important point when using views.
Post #1417210
Posted Thursday, February 7, 2013 10:03 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, December 24, 2014 11:44 AM
Points: 2,509, Visits: 1,592
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!
Post #1417212
Posted Thursday, February 7, 2013 10:22 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 11:08 AM
Points: 31,371, Visits: 15,839
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.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1417226
Posted Thursday, February 7, 2013 10:43 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Tuesday, December 23, 2014 3:10 PM
Points: 3,806, Visits: 1,237
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,


"El" Jerry.

"A watt of Ottawa" - Gerardo Galvan

To better understand your help request, please follow these best practices.
Post #1417242
Posted Thursday, February 7, 2013 10:51 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Tuesday, December 23, 2014 3:10 PM
Points: 3,806, Visits: 1,237
Got it. Here it is:

http://www.sqlservercentral.com/Forums/FindPost1349883.aspx

Saludos,


"El" Jerry.

"A watt of Ottawa" - Gerardo Galvan

To better understand your help request, please follow these best practices.
Post #1417249
Posted Thursday, February 7, 2013 1:00 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Tuesday, December 23, 2014 7:18 PM
Points: 7,930, Visits: 9,654
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
Post #1417325
Posted Thursday, February 7, 2013 1:25 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 9:42 AM
Points: 3,429, Visits: 2,039
L' Eomot Inversé (2/7/2013)
[quote]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...
Post #1417336
« Prev Topic | Next Topic »

Add to briefcase «««1234»»

Permissions Expand / Collapse