|
Why not?
Server: Message 170, Level 15, State 1, Line 1
Line 1: Syntax error near '@tt'.
Server: Message 170, Level 15, State 1, Line 18
Line 18: Syntax error near '@tt'.
set IDENTITY_INSERT @tt off
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
set IDENTITY_INSERT @tt on |
|