Discussion:
(SELECT *) in view
(too old to reply)
Leila
2006-09-29 11:21:49 UTC
Permalink
Hi,
I use (SELECT *) in a view. But it doesn't bring the new columns added to
table. When I use SELECT * it means every column! How can I get this
behavior?
Thanks in advance,
Leila
Hilary Cotter
2006-09-29 11:33:16 UTC
Permalink
When the view is created it is created with the columns present in the base
table at compilation time. To get it to reflect the current base tables
columns you will have to issue an alter view statement, ie

alter view myView
as
select * from myTable
--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
Post by Leila
Hi,
I use (SELECT *) in a view. But it doesn't bring the new columns added to
table. When I use SELECT * it means every column! How can I get this
behavior?
Thanks in advance,
Leila
Mike C#
2006-10-04 00:41:46 UTC
Permalink
You shouldn't be using SELECT * in a production environment. I can lead to
a lot more problems down the road...
Post by Leila
Hi,
I use (SELECT *) in a view. But it doesn't bring the new columns added to
table. When I use SELECT * it means every column! How can I get this
behavior?
Thanks in advance,
Leila
Continue reading on narkive:
Loading...