view is not being refreshed !

  • Me I am usually setting up vies to provide specific columns 99% of the time and it just was adopted to use the other way instead of *. I have also run into troubles in the past with views using a *, which may have been this same thing and found the output really never needed all rows so I quite there too. But I will say there is always justification for doing anything you want.

  • Don't get me wrong, but select * is the worst way to create a view.Becoz the select script with all colum name can be generated by sqlserver generate scripts.

    Also its a maintenance nightmare in case of Select * becoz it becomes very difficult to track whats wrong with the view in case when changes has been made to the reference tables.

  • I would have to agree with the comments never to use SELECT * when creating views. As you can see, you aren't saving yourself any time when a base table schema changes, as you still have to futz around to get your view to work. Using SELECT * opens you up to potential problems, especially if you were to ever remove a column. The same argument would be appropriate to never using SELECT * from a permanent table as output from a stored proc.

    If you work in any type of team environment you are likely to eventually impact others. Take the hit and select the column names. You’ll always know what you’re getting and it's easy enough to alter your view when you alter a table. A simple sp_depends will tell you which views you need to review.

  • I think we have done a good job of beating this one to death 🙂

    The reason I did a (select * ) for the view is I was trying to create what Oracle uses as synonyms. I was tired of typing CENTRAL_FACT_TABLE so I created a view called CFT

  • I had a friend who said he would sooner see a bad idea implemented well than a good idea implemented badly.

    He was refering to Mercedes windscreen wipers at the time, but the sentiments still apply.

    You get 10 points for a solution that works. No points for it being elegant, but you do qualify for a warm feeling!

  • When scripting remember to script the user/role-autorities as well !

    As for the warm feeling : Enjoy it as much as possible!

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply