Cannot perform alter on 'dbo.ObjectName' because it is an incompatible object type

Now you could try it yourself:

--First, we create a inline-table function which returns a table

Create Function dbo.ufnFunctionTest (@param int, @param1 int)

returns table

AS

RETURN

(

select 1 as id

)


--Then, we want to alter it to a multi-statement table-valued function,

--and we will get an error here

alter Function dbo.ufnFunctionTest (@param int, @param1 int)

returns @tt table

(

    id int


begin

insert into @tt values (1)

return

end


if  you really want to "alter" the type of your function, actually you need to drop it first, then create a new one.

解决方法:先删除ufnFunctionTest ,再创建ufnFunctionTest 。

http://www.cnblogs.com/xingyukun/archive/2008/05/21/1203711.html

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 'EastRiver' 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...