|
declare @tt table (sid tinyint identity (1,1), v decimal (18,2), st tinyint)
insert into @tt
select # 1.vs,
case
when ... then 0
when ... then 1
when ... then 2
end si
from fd () # 1
inner join
fs ('') # 3
on # 1.id = # 3.id
order by vs, si
It will go wrong:
Server: Msg 8101, Level 16, State 1, Line 3
You can specify an explicit value for the identity column in the table '@tt' only if a list of columns is used and IDENTITY_INSERT is ON.
If you remove order by vs, si, nothing will go wrong!
vs is decimal data. |
|