A bug in the view in SQL Server 2000

Source: Internet
Author: User
server|sqlserver| View yesterday (Horizon over Yo), in the Central Suzhou Electronics Co., Ltd. production of the note in the Library management system encountered a strange problem.
A few days ago I tested a good program, yesterday to test the tester came to a baffling error, today's bug report brought, I was caught in a strange trap, because our project with a large number of views, of course, this error on the view. Is the "*" in the view, haha.

Test environment:
Os:windows Server 2000/2003
Microsoft sqlserver:2000 Simplified Chinese Enterprise Edition

Test Steps (Demo):
The first step, let us create a new database, the database name is called "Test", the other options are selected by default:


In the second step, create a table "T1" in the test database:
It has three fields, the order is C1,C2,C3, the data type doesn't matter


Step three, create a view in the test database "V1" (no matter how complicated it is, but note that you need to use * instead of a list, because * will cause the following error to happen yo)


Step fourth, add a column of "T4" to the table "T1" to make this column between "C2" and "C3"


Step Fifth, insert a piece of data in table "T1":


Step sixth, open the View "V1" Go and take a look (hey, what do you see?) ):

Then open the table "T1" to see (Haha, fun):



Step seventh, take the View "v1" Open Design view to perform the design (or rerun the statement that modifies the view), it is normal.

So, we in view try not to use * Yes, hey, if you use the *, if you change the table structure, you do not forget to update the relevant view of the design, hehe.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.