SQL Server has a strange problem (2000/2005 all have this problem ):
The mm_bjjhmx table has the ID of the auto-increment column of the primary key, and a column "sequence number" is also required ".
Run the following statements:
Select Identity (INT, 1, 1) XH, A. * into # TB
From mm_bjjhmx
Where bjjhid = 4
Order by A. bjbm, A. bjmc;
Select * from # TB
Drop table # TB;
Always error:
Message 8108, level 16, state 1, 1st rows
You cannot use the select into statement to add an ID column to the '# tb' table. The table already contains the 'id' column that inherits the ID attribute '.
However, the following statements are normal:
Select Identity (INT, 1, 1) XH, A. * into # TB
From mm_bjjhmx a left join mm_bj on mm_bj.id = A. bjid
Where bjjhid = 4
Order by A. bjbm, A. bjmc;
Select * from # TB
Drop table # TB;
That is, if multiple tables are associated, the columns displayed are the same, but the former cannot be used, and the latter is normal. It's strange that some people who know it can help explain it, but it is also a solution.