Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New column in SQL table/view not showing in query results

Tags:

sql-server

I added a new column to a view in Microsoft SQL Server Management Studio. The data area for the modified view displayed the new column. However when I tried to run a query (e.g. SELECT * FROM uvMyNewView) against that view, it wouldn't display the new column.

like image 656
P.Turpie Avatar asked Oct 28 '25 14:10

P.Turpie


1 Answers

I found the solution on the mssqltips website.

exec sp_refreshview [uvMyNewView]
go
select * from [uvMyNewView]
go
like image 89
P.Turpie Avatar answered Oct 31 '25 04:10

P.Turpie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!