代码如下:
InsertINTO@tableSelect'AAA'
UNIONALLSelect'CCC'
UNIONALLSelect'EEE'
UNIONALLSelect'DDD'
UNIONALLSelect'BBB'
Select[RowID]=IDENTITY(int,1,1),*INTO#FROM@table
Select*FROM#
DropTABLE#
原文链接:https://www.f2er.com/mssql/64495.htmlUNIONALLSelect'CCC'
UNIONALLSelect'EEE'
UNIONALLSelect'DDD'
UNIONALLSelect'BBB'
Select[RowID]=IDENTITY(int,1,1),*INTO#FROM@table
Select*FROM#
DropTABLE#