January 28, 2010 at 12:25 pm
How to add a column to a view.
In ABC database, in the table TABLE1, there is a column called “COLUMN1”.
how to publish this column in the view “VIEW1” under the name “COLUMN1”?
January 28, 2010 at 12:59 pm
ALTER VIEW <ViewName>
AS
<Entire select statement here>
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 28, 2010 at 1:26 pm
If your view contains something like this
SELECT * FROM FooTable
... and you want to see your new columns automatically after adding to your table, have a look to BOL for sp_refreshview.
... after this, forget sp_refreshview and get rid of "SELECT *" 😉
Greets
Flo
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply