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 07, 2013 7:26 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: Yesterday @ 9:30 AM
Points: 830, Visits: 1,197
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 07, 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: Friday, March 15, 2013 3:24 PM
Points: 662, Visits: 68
Nice 1 Steve. However, I don't recommend anyone to use SELECT * FROM in view.
Post #1417083
Posted Thursday, February 07, 2013 8:58 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: 2 days ago @ 1:46 PM
Points: 18,732, Visits: 12,329
Thanks Steve



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server 2008


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1417141
Posted Thursday, February 07, 2013 10:00 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 9:58 AM
Points: 2,570, Visits: 1,530
Good question, thanks Steve. Definitely highlights an important point when using views.
Post #1417210
Posted Thursday, February 07, 2013 10:03 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 5:47 PM
Points: 1,889, Visits: 935
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 07, 2013 10:22 AM


SSC-Dedicated

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

Group: Administrators
Last Login: Yesterday @ 1:47 PM
Points: 31,406, Visits: 13,722
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 07, 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: Thursday, May 02, 2013 3:45 PM
Points: 3,748, Visits: 928
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
Post #1417242
Posted Thursday, February 07, 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: Thursday, May 02, 2013 3:45 PM
Points: 3,748, Visits: 928
Got it. Here it is:

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

Saludos,


"El" Jerry.

"A watt of Ottawa" - Gerardo Galvan
Post #1417249
Posted Thursday, February 07, 2013 1:00 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 11:59 AM
Points: 7,076, Visits: 7,115
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
Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
Post #1417325
Posted Thursday, February 07, 2013 1:25 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 9:58 AM
Points: 2,570, Visits: 1,530
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