SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Updating Views


Updating Views

Author
Message
sestell1
sestell1
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3464 Visits: 3508
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!
jagpatel9
jagpatel9
Say Hey Kid
Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)Say Hey Kid (692 reputation)

Group: General Forum Members
Points: 692 Visits: 69
Nice 1 Steve. However, I don't recommend anyone to use SELECT * FROM in view.
SQLRNNR
SQLRNNR
SSC Guru
SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)SSC Guru (64K reputation)

Group: General Forum Members
Points: 64377 Visits: 18570
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

Ken Wymore
Ken Wymore
SSCertifiable
SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)

Group: General Forum Members
Points: 6499 Visits: 2396
Good question, thanks Steve. Definitely highlights an important point when using views.
Miles Neale
Miles Neale
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4196 Visits: 1695
Hugo Kornelis (2/7/2013)
paul s-306273 (2/7/2013)
Steve - 0 points to you for creating a view using 'select *'...
:-P

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!
Steve Jones
Steve Jones
SSC Guru
SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)

Group: Administrators
Points: 141402 Visits: 19416
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 *'...
:-P

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
My Blog: www.voiceofthedba.com
EL Jerry
EL Jerry
SSCarpal Tunnel
SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)

Group: General Forum Members
Points: 4340 Visits: 1345
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.
EL Jerry
EL Jerry
SSCarpal Tunnel
SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)

Group: General Forum Members
Points: 4340 Visits: 1345
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.
Tom Thomson
Tom Thomson
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25340 Visits: 12488
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

Ken Wymore
Ken Wymore
SSCertifiable
SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)SSCertifiable (6.5K reputation)

Group: General Forum Members
Points: 6499 Visits: 2396
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...
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search