日期:2014-05-17 浏览次数:20553 次
CREATE TABLE [dbo].[Tmp_Tbl]( [TypeID] [smallint] NOT NULL, [TypeName] [nvarchar](128) NULL, [Caption] [nvarchar](128) NULL ) ON [PRIMARY] IF OBJECT_ID (N'fn_test') IS NOT NULL DROP FUNCTION fn_test GO CREATE FUNCTION fn_test (@ID Int) RETURNS TABLE AS RETURN ( Select TypeID, TypeName, Caption From Sy_Datatypes Where TypeID=@ID ) GO Select *, (Select TypeName from dbo.fn_test(A.TypeID)) TFld from SY_DataTypes a
------解决方案--------------------
是不是兼容模式出问题
EXEC sp_dbcmptlevel databasename, 90;