if not exists (select name from dbo.sysobjects where name='F_T_GetMianginPrice') begin exec('create FUNCTION dbo.F_T_GetMianginPrice() returns @tbl table(ID int) as begin return end') end