March 18, 2002 at 8:51 am
Hi,
I use sp_refreshview to refresh my view when I change the structure of my table. It works when I add a column to my table but if I remove a column and run sp_refreshview on my view, the following error occur :
Server: Msg 4502, Level 16, State 1, Procedure vwRR, Line 5
View 'vwRR' has more column names specified than columns defined.
Server: Msg 4413, Level 16, State 1, Line 5
Could not use view 'vwRR' because of previous binding errors.
Is there any other stored procedure I should use for this ?
Thank you,
DaSaint
March 18, 2002 at 9:46 am
March 18, 2002 at 11:23 am
I don't want to alter my view because it is very big and I need to run all my SQL script at my customer office so I want my SQL scripts to be short as possible.
Do you have any others ideas ?
Thanks,
DaSaint
March 18, 2002 at 11:27 am
The error sounds like you still have an item in it that no longer exists in the table. Are you saying you want something that will remove for you? If so I can easily cook something up I am sure.
"Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)
March 18, 2002 at 11:34 am
Yes I remove a column from my table. Since sp_refreshview is working when I Add a column I wonder why there is nothing to refresh a view when I remove a column froma table. Don't cook nothing, I just want to know if there is something that exist to refresh my view when I remove rows from my tables ?
Thanks
March 18, 2002 at 11:56 am
ANswer is no, I cannot find anything to do this. Also sp_RefreshView is actually an extended stored procedure so I cannot see if there is anything you could add to it to do.
"Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)
March 18, 2002 at 1:59 pm
Are you doing select * or explicitly naming all the tables? How big can the script possibly be?
Andy
March 18, 2002 at 2:37 pm
This view link 15 tables. It is BIG. All the table are named explicitly but one of them is like "Table.*" because its the principal table of this view.
Any ideas or solution to refresh the view when I remove a field from the table from who I "select *" ???
Thanks
March 18, 2002 at 4:18 pm
Sorry, I guess Im still not clear - does it matter how big it is? That's the whole point of sp_refreshview, you can run the alter and when it's done do the refresh. How long does it take to create the view when you run it?
Andy
Viewing 9 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy