473,416 Members | 1,561 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

View field content update when "real" table fields change

Hi,

I use view to join difference table together for some function. However,
when the "real" table fields changed (e.g. add/delete/change field). The
view table still use the "old fields".

Therefore everytimes when I change the real table, I also needed open the
view table and save it by SQL enterprise manager manually for update the
view table field.

Can we use a SQL command or other method to update it directly?

Regards,
Silas
Sep 1 '05 #1
4 3117
So you are using SELECT * in your views rather than list the column
names? That's not a good idea. if you forget to update the view the
results can be unreliable when you drop and then add a column. Best
practice is to list the columns individually.

Do you always make schema changes directly through Enterprise Manager?
As you are discovering, that's hard work. Use scripts to make any
schema changes. You have more control that way, you also have a record
of what changed, you can more easily roll back changes if you need to
and you can reliably test out the change before you deploy it into
production. Using a script just requires an ALTER VIEW statement to
update your view. If you use Query Analyzer to do it then you don't
even need to type the column names yourself - drag the column list from
the Object Browser.

--
David Portas
SQL Server MVP
--

Sep 1 '05 #2
Check out sp_refreshview in BOL

Sep 1 '05 #3
David Portas (RE****************************@acm.org) writes:
Do you always make schema changes directly through Enterprise Manager?
As you are discovering, that's hard work.


Add to that the Modify Table function has some really horrible bugs, and
there are several problems with the scripts they generate.


--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Sep 1 '05 #4
Thanks and it works.

<ma******@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Check out sp_refreshview in BOL

Sep 2 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Nobody | last post by:
Heres the deal... I have an application where I have a list (as in a Windows list control, but thats not important) displayed to the user. I sort this list based on the list controls sort function...
0
by: Simon Verona | last post by:
I have some Windows Forms software that I'm developing that uses a remote server (called using remoting) to provide the business rules and dataaccess. For development purposes the client and...
3
by: astro | last post by:
I have a datagrid that is two levels down from the dataview (i.e. grandchild). I have spent 3 hours trying to get the syntax of determining it's real datasource (i.e. not it's source based on it's...
3
by: TCB | last post by:
Hi, There are a couple of things that are bothering me, any help on these is greatly appreciated. This is using ASP.NET 2.0 1. I am sending email in my web app, using a simple form here is the...
30
by: bblais | last post by:
Hello, Let me start by saying that I am coming from a background using Matlab (or Octave), and C++. I am going to outline the basic nuts-and-bolts of how I work in these languages, and ask for...
3
by: shripaldalal | last post by:
hi all, i have the following fields.... Document_Name, Document_No, Document_Date, Order_No, Order_Date, Peripheral The first 5 you can understand, peripheral is a memo field which...
1
by: Tyno Gendo | last post by:
Hi everyone I need to move on a step in my PHP... I know what classes are, both in PHP4 and 5 and I'm aware of "patterns" existing, but what I'm looking for are some real world projects eg....
71
by: Jack | last post by:
I understand that the standard Python distribution is considered the C-Python. Howerver, the current C-Python is really a combination of C and Python implementation. There are about 2000 Python...
1
by: jamesicus | last post by:
.......... just for curiosity? "real" XHTML served as content (MIME) type application/xhtml+xml will display in MSIE 6.0 release 2900 and 7.0 but they will not render xml content. However, MSIE...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.