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 Wednesday, February 6, 2013 8:56 PM


SSC-Dedicated

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

Group: Administrators
Last Login: Today @ 2:28 PM
Points: 33,062, Visits: 15,174
Comments posted to this topic are about the item Updating Views






Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1416795
Posted Wednesday, February 6, 2013 8:57 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 12:17 PM
Points: 5,566, Visits: 24,732
Nice question .... but Steve had I know it was you who created the QOD would still having me wondering what the answer might be.

If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
Post #1416796
Posted Wednesday, February 6, 2013 9:34 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 24, 2014 6:38 PM
Points: 1,371, Visits: 1,560
Nice question Steve!

~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter

Post #1416800
Posted Wednesday, February 6, 2013 9:35 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 24, 2014 6:38 PM
Points: 1,371, Visits: 1,560
bitbucket-25253 (2/6/2013)
Nice question .... but Steve had I know it was you who created the QOD would still having me wondering what the answer might be.


+1
Definitely, I would have also thought that there is some kind of gotcha


~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter

Post #1416802
Posted Wednesday, February 6, 2013 11:19 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Sunday, July 20, 2014 11:20 PM
Points: 13,252, Visits: 10,133
Nice question Steve, thanks.



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1416812
Posted Thursday, February 7, 2013 12:21 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, July 15, 2014 3:00 AM
Points: 252, Visits: 225
nice quetion... EXEC sp_refreshview MyView is correct answer.

but what is the use of 'ALTER VIEW MyView ADD SCHEMABINDING'. Schema binding binds your views to the dependent physical columns of the accessed tables specified in the contents of the view, i.e. if MyView is schema bind no one will be able to alter the dbo.MyTable table unless they drop the table.

Just think that someone drops/alters the table dbo.MyTable without paying any heed to our view. Now that would leave our view nowhere. Hence schema bind it, this will prevent any such accidents from happening.


Manik
Go fast as possible


Manik
You cannot get to the top by sitting on your bottom.
Post #1416832
Posted Thursday, February 7, 2013 12:23 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: Thursday, June 5, 2014 8:36 AM
Points: 926, Visits: 556
Nice and easy one one.

I got a second thought whether there is any database level set option to make a view referesh automatically.. finally I ensured there is no such option..


--
Dineshbabu
Desire to learn new things..
Post #1416833
Posted Thursday, February 7, 2013 12:36 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Saturday, May 31, 2014 9:19 PM
Points: 1,128, Visits: 1,162
Lokesh Vij (2/6/2013)
Nice question Steve!

+1

Thanks for the question.......


~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one
Post #1416836
Posted Thursday, February 7, 2013 1:02 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: Thursday, June 5, 2014 8:36 AM
Points: 926, Visits: 556
Hi mani,

Thanks for spending your time to explain about schema Binding.

manik123 (2/7/2013)


If MyView is schema bind no one will be able to alter the dbo.MyTable table unless they drop the table.


If a view is schema bound, even dropping the table is also not possible. Either you need to drop the view or you need to remove schema binding. You can just modify the columns which is not included in view definition.


manik123 (2/7/2013)

Just think that someone drops/alters the table dbo.MyTable without paying any heed to our view. Now that would leave our view nowhere. Hence schema bind it, this will prevent any such accidents from happening.


There are few limitations in schema binding like all the objects should be within the same database. You cannot use synonyms in view definitions etc...


--
Dineshbabu
Desire to learn new things..
Post #1416845
Posted Thursday, February 7, 2013 1:03 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: Thursday, June 5, 2014 8:36 AM
Points: 926, Visits: 556
Please some one list the limitations of schema binding a view.

--
Dineshbabu
Desire to learn new things..
Post #1416846
« Prev Topic | Next Topic »

Add to briefcase 1234»»»

Permissions Expand / Collapse