SQLServer 2000 in a bug

xiaoxiao2021-03-06  45

Yesterday (zero is over), in Suzhou Middle Electronics Co., Ltd., the production of affordable issues in the library management system encountered a strange problem.

I have tested a good program before, yesterday, I got a inexplicable mistake after testing the tester. Today, the BUG report is brought, I have fallen into a strange circle, because our project has used a lot of views, Of course this error is 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 (demonstration):

The first step, let us create a new database, the database name is called "test", and the other options choose the default:

Step 2, create a table "T1" in the TEST database:

It has three fields, and sequence is C1, C2, C3, and data types, respectively.

In the third step, create a view "V1" in the TEST database (no matter how complicated, not, pay attention to you want to use *, not one item, because * will cause the following error to occur.

)

In the fourth step, add a "T4" in the table "T1", let this list between "C2" and "C3"

Step 5, insert a data in the table "T1":

In the sixth step, open the view "V1" to see (Hey, what did you see?):

Open the table "T1" to see (haha, fun):

Step 7, re-execute the view "V1" open design view (or re-execute the statement that modify the view), it will normal.

So, we try not to use * in the view, hehe, if you use *, you don't forget to update the relevant view, huh.

转载请注明原文地址:https://www.9cbs.com/read-79433.html

New Post(0)