Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Adding a column to a view

Author  Topic 

tshaw20832
Starting Member

10 Posts

Posted - 2014-05-09 : 15:04:27
All,

I have a view that was created by my predecessor. The was created by another view. I need to add a column but when I do and then execute the view, no data comes across. When I remove the column, the data is populated again. The views name is .dbo.viewname_vw as a. I cant find the view in the database. Any ideas.

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2014-05-10 : 12:17:48
Are you adding the column to the table or the view?You may need to execute a sp_refreshView . Check:http://www.sqlserver-dba.com/2011/01/sql-server-refresh-all-views.html

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

tshaw20832
Starting Member

10 Posts

Posted - 2014-05-12 : 07:57:10
Add it to the view.
Go to Top of Page

djj55
Constraint Violating Yak Guru

352 Posts

Posted - 2014-05-12 : 08:42:27
Can you not find the origin view that your view is based? What if you run a select through SSMS?

djj
Go to Top of Page
   

- Advertisement -