Is there a way to alter (drop and create) user defined Table type without dropping dependent object.
I have this table type
CREATE TYPE [dbo].[ttOrderItems] AS TABLE(
[Position] [int] NULL,
[ItemCode] [varchar](16) NULL,
[QtyOrdered] [int] NULL,
[UOM] [varchar](2) NULL,
[PriceQuoted] [decimal](10, 2) NULL
)
and dependent table type function
CREATE function [dbo].[ftCatalogItems](@comno varchar(3),@cuno varchar(6),@items ttOrderItems readonly) returns table as
/*-------------------------------------------------------
DECLARE @COMNO VARCHAR(3)='010',@CUNO VARCHAR(6)='000164'
declare @items ttOrderItems;
select * from @items
insert @items
select '1231-221',1,'EA',20.20
union select '110223-245',10,'EA',2001.20
--------------------------------------------------------*/
return(
select Position,ItemCode,QtyOrdered
,PriceQuoted
,Net
,t$qanp QtyApplicable
,Status=case
when t$item is null then 'Not in Catalog'
when t$stdt > getdate() then 'Availle only on or after '+Convert(varchar(30),t$stdt,106)
when datediff(DD,getdate(),isnull(nullif(t$tdat,''),'4712-01-01')) < 1 then 'EXPIRED'
when items.PriceQuoted != Net then 'Quoted Price do not match Catalog price'
else Null
end
from @items items
Left Join ediCatalog c on ltrim(c.t$item)=ItemCode AND COMNO=@COMNO AND T$CUNO=@CUNO and c.[Server]=dbo.fsBaanServer()
)
Now I want to alter (drop/create) the type ttOrderItems,. How can I do this without first dropping the ftCatalogItems ?