I have a sql function and i need to declare few variables in that function. Please advise how can i achieve this.
For example i need to put -->
Declare @ClientResult TABLE(
RowIndex int identity(1,1),
SplitText varchar(50)
)
in the below function.
create FUNCTION [dbo].CLIENT_SHIPPINGREPORTDATA_Function_Test
(
@CLIENTPK_NEW TABLE,
@CGNEEPK TABLE
@type varchar(100)
)
RETURNS TABLE
AS
RETURN
SELECT distinct
OP_PartNum,
OP_PK
FROM Client_whsPallet pallet
I am using sql server 2005
Thanks