select identity(int,1,1) as uid ,t.* into #universal from ('+@SQL+') as t
当@SQL中有自动增量的字段时,就会抛出以下的异常(server2000不会显示错误,2008有)
Msg 8108, Level 16, State 1, Line 1
Cannot add identity column, using the SELECT INTO statement, to table '#universal', which already has column 'guidance_id' that inherits the identity property.
不支持二个自动增量的字段同在一个查询语句中。
要如何修改好呢?
:shock: